Peter Linder :  May-2018

The Role of Hardware and Trusted Execution Environments in Blockchain Scaling and Security
*Hardware is not just about ASICs for mining. It will impact the next-generation design of blockchain peer nodes, remote utilities, and infrastructure*

The introduction of new ASIC mining hardware for accelerated computation of proof-of-work algorithms has recently jolted the blockchain community into an increased awareness and discussion of hardware. But hardware impacts all aspects of blockchain architecture including peer nodes and network infrastructure. Firmware and microcode increasingly blur the line between hardware and software. Moreover, blockchains provide an opportunity to re-think and extend the traditional notions of Trusted Execution Environments to make them far more useful.

As a community, we pay insufficient attention to the dramatic impact which these items exert on scaling and security.

This is the first in a series of blogs in which I will examine some of the multi-disciplinary complexities of this topic. The next few blogs in this series are in various stages of being written. But I welcome constructive feedback in all forms and will adjust future blogs as needed. Because ultimately this is a vision for the future and my contribution here is just to point out some trends and to make some suggestions.

Part 1: Some Thoughts About the Past and the Future

Some context:

What follows in this series of blogs is an assessment of the hardware industry today as it relates to bitcoin and other blockchains, and what may be possible in the future. It is my personal viewpoint, so it is fair to ask why anyone should believe what I say. I could certainly be wrong on various details, and I fully expect that I will be. But I believe that most of the vision described below will come to pass eventually, and I ask your indulgence in considering that possibility.

I have spent most of my engineering career working with large semiconductor manufacturers, designing and supporting some of the highest volume and most cost sensitive computer chips, and shorter periods working in system design, networking, and cyber-security. Ever since I became obsessed with bitcoin 2-1/2 years ago, I have striven to see how bitcoin "fits in" to computing as an evolutionary step from the past to the future. Although hardware is no longer my primary focus and is not considered "sexy" by today's standards, hardware is critical to the future of any computing technology, and it seems appropriate to take advantage of past experience when attempting to predict the future. To understand the state of computer hardware today and the trends taking shape, it is necessary to examine both the progress of the technology as well as the forces and changes in the business climate which motivate and shape its future path. I try to take both into account. I hope that you find it as interesting and motivating as I have.

A little history:

"People who are really serious about software should make their own hardware"
-Alan Kay, computer pioneer, inventor of the GUI

When considering computing in a historic perspective, we might look to the innovations which accompanied the wide adoption of personal computers but did not exist on mainframes. Central to the improved usability of the PC was the invention of the mouse and the graphical user interface at the Xerox Palo Alto research center. It was there that both Bill Gates and Steve Jobs first saw this concept and decided to go about implementing it in their own companies. The engineering manager of that effort at Xerox, Alan Kay, was (and still is) a true computer pioneer who also introduced the world to many other new and importance advances including object oriented programming. Alan has become famous for saying that "People who are really serious about software should make their own hardware".

This may sound trivial, but think about it. Would computers be useful at all if we were still feeding them with punched cards? Or constrained exclusively to typing commands in terminal windows? At every stage of the evolution of computers, the hardware has adapted to better suit the usability and performance needs, co-designed with the best software solutions. Blockchain will be no different. We are seeing it in mining ASICs, but that is only the beginning. Hardware may not be viewed as sexy but it is vital and can be very innovative. And that implies that customized hardware is inevitable.

Let me provide a simple example of just how powerful a force hardware optimization is, even for main-stream run-of-the-mill computing. For a number of years now, the semiconductor industry has struggled with the fact that Moore's Law is coming to an end. Moore's Law, named after one of the founders of Intel who observed that integrated circuits would keep adding transistors and getting smaller, drove both the miniaturization and constant product price reductions of the computer industry for the past 50 years. We will talk more about that later. But for now, just accept that the last 5 years (at least) have not seen the same trends. It is still possible to make electronics smaller, and that will continue to be the case. Engineers are clever people who rarely run out of ideas. But the latest and densest technology is no longer the cheapest. Being at the leading edge is now becoming increasingly expensive. That may change if the engineering wizards come up with new more cost effective strategies for miniaturization, but for now, we are somewhat stuck.

Taking that into account, let's take a quick look at the hardware used by Apple. These are not leading edge super-computers. But every year, Apple has introduced another A-series System-on-a-Chip for its products, and has managed to dramatically improved performance. But it is not Moore's Law which is driving this trend. It has been Apple's compulsive desire for complete control of the silicon, custom co-designed to optimally match their software. For more details, you might look HERE, where the author concludes "The next little while - somewhere between twenty and fifty years out - will be dominated by a transition from software into hardware, a confusion of the two so complete it will literally become impossible to know where the boundary between the two lies."

Of course Apple has always been known for great product design in which the hardware and the software are carefully crafted for optimal user experience. How well has this worked? Historically, this is a great time to ask that question based on Apple's announced results for the March 2018 quarter.  You can read some details HERE where CNBC explains:

Apple made more profit in three months than Amazon has generated during its lifetime

Of course we can debate how much profit Amazon may make in the future. Or whether Apple has been good to the open source software community or to people who want complete control of their devices (I personally have chosen to never own an Apple product). But the fact remains- hardware co-design to optimally match the software and other application needs is an enormously powerful formula for success in computing!

Trends in the semiconductor industry:

We have already discussed the slow-down and possibly the end of Moore's Law, and the fact that System-on-a-Chip performance can still be improved by careful hardware and software co-design even if CPU performance improvements no longer come for free. But there are much larger implications. If CPU performance no longer improves automatically every few months, then it is both necessary and worthwhile to do more focused hardware design work to optimize specific applications. And since computing overall is growing in volume globally,  it is becoming increasingly cost effective to design custom silicon as hardware accelerators for specific needs. It turns out that there are quite a few applications where custom silicon designs can achieve perfomance improvements of 1000x or more over a general purpose CPU. This is a general phenomenon, not only one restricted to mining ASICs. Moreover, if custom hardware design can yield more than 1000x performance gains, while shrinking a silicon chip to the latest technology node produces only modest performance improvements at an increased price, then the most cost-effective hardware solution is increasingly not at the leading-edge manufacturing technology node.

The most cost-effective hardware solution is increasingly not at the leading-edge manufacturing technology node.

This is what has been driving the increased volume of computer chip manufacturing at silicon "foundries", where fabless semiconductor design houses contract to build their products. The "Win-Tel" former monopoly of years gone by no longer drives all volume. Last year, the semiconductor division of Samsung surpassed all of Intel in semiconductor revenues. Excluding memory chips, fab foundries are building an increasingly important assortment of ICs. Of course established players like Nvidia and AMD continue to have leverage when negotiating manufacturing capacity and prices, but for the most part they continue to be "fabless" design houses who contract manufacturing from merchant foundries. This dynamic is creating an environment where custom hardware for common functions is becoming not only increasingly practical, but increasingly inevitable. I totally understand and empathize with David Vorick's frustrations HERE regarding mining ASICs. Fortunately, for reasons which will be discussed in a future blog, although ASICs will become increasingly unavoidable, they will not always result in mining centralization.

The era of the general-purpose CPU is weakening like never before, both from a cost/performance viewpoint, and also from a security viewpoint (more on that later).

Here are just a few example trends toward hardware customization for performance improvement beyond CPUs and GPUs:
  • The Intel Movidius VPU (Vision Processing Unit), which can reach over 100 GFLOPs of performance within a nominal 1W of power consumption: HERE and HERE
  • The Google TPU Artifical Intelligence chip, which is 30-50x faster than a server-class Intel Haswell CPU or Nvidia K80 GPU and 25-80x better performance per watt: HERE, HERE, and HERE
  • The Darwin co-processor for genomic sequence alignment which, without sacrificing sensitivity, provides up to 15,000x speedup: HERE
  • The use of FPGAs in the Microsoft Azure cloud infrastructure as computational accelerators: HERE
  • The Mythic deep neural network AI accelerator that could be 10,000 times faster than todays GPUs: HERE
  • For those with a sense of humor- the 50,000,000,000 Instructions Per Second BrainFuck Computer using Xilix Vertex 7 FPGA: HERE

Why blockchain needs new hardware designs:

Let me be clear- designing a custom computer chip and contracting for silicon fabrication, packaging, testing, inventory, and so forth is still an expensive and risky proposition. It cannot be compared to two people with laptops writing software. But let us be honest- what percentage of significant projects in the cryptocurrency space can accurately be described as two people with laptops writing software? Looking at it from the other direction, there are certainly successful fabless semiconductor companies which started out as two engineers with laptops and CAD software and some risk capital. Most worthwhile hardware projects today will require quite a bit more than that for a reasonable chance of success, but it is still possible. The fact is that customized silicon design is being done for an increasing number of niches. The required investment is certainly no longer out of reach of quite a few of the largest cryptocurrency projects. Customized hardware which is useful across multiple cryptocurrency projects or which benefits the entire community could be easily justified financially.

The required investment is certainly no longer out of reach of quite a few of the largest cryptocurrency projects.

The appropriate question, of course, is:
    1) what can the blockchain community gain from customized hardware?
But also:
    2) what are the risks to the community of NOT implementing customized hardware?

The answers to these questions will be analyzed in depth in future articles in this blog series. Although I already know quite a few items which belong on both lists, it is not practical to cover everything all at once here. But it is certainly possible and worthwhile to examine the questions and potential answers in general terms.

With respect to question #1, the primary goal of custom hardware is usually improved performance-per-watt to operate or performance-per-dollar to purchase. Let's agree for the moment that we will examine multiple examples of such performance benefits in future blogs. What is the motivation to take advantage of these benefits if in fact we can prove that they exist? Anyone who has been paying any attention to the debates in blockchain  is aware of the challenges of scalability and the many compromises which are being tried to address the problems. There is not shortage of great minds diligently searching for solutions. The blocksize debate appears to have no ending or solution. Looking at consensus algorithms, Paul Sztorc's periodic essays in defense of Proof-of-Work in rebuttal to Vitalik's Proof-of-Stake essays are always fascinating reading. Of course there are many newer algorithms being tested or developed including DPOS, Proof-of-Space, Proof-of-Space-Time, Proof-of-Capacity, Algorand, Thunderella, Dfinity, Ouroboros, and Casper. Consensus algorithms are furthermore not the only architectural compromise being considered. Klye Samani's analysis HERE gives a good framework and overview.

Some of these ideas will hopefully withstand the test of time and some of them may in fact prove necessary. But if hardware can be optimized to yield significant performance improvements, we should certainly consider taking advantage of all such opportunities before making fundamental compromises to protocols. If we can identify a few 10x or 100x hardware opportunities or even a single 1000x opportunity, the optimum path forward may change dramatically. Yes, POS and other consensus algorithm may prove trustworthy, but for critical applications for which POW can be made to have sufficient performance, we should certainly try to maintain it. Do not misunderstand me- I strongly support EOS and a number of other projects because I support all efforts which involve skilled experienced engineers in well-funded projects trying to do anything which will increase user adoption of blockchain or even semi-blockchain for real world use cases and hopefully a killer app or two. The solutions which hardware optimization and fog computing encompass apply to EOS and other platforms equally well. But for critical applications it seems prudent to make as few compromises as possible at the protocol level which can be fixed with hardware and other higher level solutions. There are plenty or other challenges to address such as governance and account recovery mechanisms without having to surrender core protocol security for the sake of something as basic as scalability. Blockchain dollar volume today is a tiny percentage of the economy, and I fear that the real opposition will not emerge until it is much larger and a greater threat to central banks. I am not a bitcoin maximalist, but for critical applications I see the value of a totally bullet-proof lowest layer in case it turns out to be needed for survival.

With respect to question #2, the fundamental issue is that software can be no more trustworthy than the hardware it runs on. Blockchains cannot change that fact if there is too much homogeneity in the hardware. On close inspection, the lack of trustworthiness and the level of homogeneity in today's common hardware is shocking. In a future blog, we will examine in detail some of the pervasive unpatched vulnerabilities as well as the structural reasons why these problems will not go away. We will also discuss the very real possibility of a nation-state or even a clever hacker bringing down the bitcoin network due to pervasive vulnerable homogeneous hardware. But those are topics for later.

Software can be no more trustworthy than the hardware it runs on.

A few of the items still to come in future blogs:
    Some day in the future -
  • We will talk about bitcoin mining centralization as a dangerous but brief phase which bitcoin went through.
  • Many applications will consist of decentralized software running on blockchains rather than centralized software owned by malicious mega-corporations. Moreover, that software will be running on a decentralized fog computing grid, managed by blockchains, owned and maintained by vastly dispersed and heterogeneous individuals and organizations rather than running on hardware mega-clouds owned by malicious mega-corporations.
  • Open hardware designs of simple computational hardware engines without memory caching or speculative execution in order to guarantee fully deterministic synchronous operation not susceptible to Spectre/Meltdown type vulnerabilities will be readily and inexpensively available from multiple silicon foundries.
  • The launch of a new blockchain will often include the design, defensive patents, and open source release of an accompanying asic hardware design for its consensus algorithm in order to encourage investment and commitment by a diverse community and to help prevent powerful asic whales from patenting and monopolizing the mining.
  • Specialized Blockchain Processing Unit (BPU) chips will be common with architectures optimized for the unique computational demands of peer-to-peer nodes.
  • Network hardware optimizations will provide performance benefits better than those which can be achieved by sharding.
  • Blockchain projects which intelligently use optimized hardware will exhibit insurmountable advantages over those that do not
Copyright 2018 by Peter Linder