文档章节

Building for the Blockchain

openthings
 openthings
发布于 2018/01/11 09:48
字数 2070
阅读 31
收藏 0

Introduction

If you’re here, we assume that you’re a developer/hacker who’s intrigued by the blockchain. You’re convinced that you understand how it works and now you’re itching to figure out what the blockchain means for you and your developer skill set.

If you need more of a primer we’d recommend starting with the bitcoin white paper and Ethereum white paper.

Our goal in this post is to:
1. Explain how blockchain development differs from existing development paradigms
2. Provide context for the opportunities and challenges in this space
3. Point you to resources that will give you the foundation to start developing in this new paradigm

Paradigm Shifts for Developers

Internet applications benefit from network effects because they maintain centralized silos of information. Built upon shared, open protocols (e.g. TCP/IP, HTTP), companies like Yelp, Facebook, and Amazon benefit from having all of their users – and, as a result, data – in one place. This way they not only have an advantage over competitors with less data but also complete control over the way they monetize the data. In the words of crypto investor Joel Monegro, the current Internet paradigm captures most of its value through fat application layers, whereas the thin, underlying communication protocols capture minimal value.

Alternatively, the distribution of value in the blockchain paradigm can be described with fat protocols and a thin application layer. This paradigm shift is possible due to the innovation of cryptographic tokens, which are described well by Albert Wagner of USV:

“Historically the only way to make money from a protocol was to create software that implemented it and then try to sell this software (or more recently to host it)… With [cryptographic] tokens, however, the creators of a protocol can ‘monetize’ it directly and will in fact benefit more as others build businesses on top of that protocol.”

Previously, the creators of open communication protocols for the Internet, largely DARPA researchers and non-profit contributors, could not align financial incentives with protocol development. In contrast, protocol creators today can issue “tokens”, like Bitcoin and Ethereum, that represent the value of their decentralized protocols.

Monegro believes that this paradigm shift affects the way that developers should think about their applications: “The combination of shared open data with an incentive system that prevents “winner-take-all” markets changes the game at the application layer and creates an entire new category of companies with fundamentally different business models at the protocol layer.”

Ethereum

We’ve come to the understanding that in the blockchain paradigm, developers can capture value through protocol innovation. To continue our discussion, we review how blockchain technologies evolved to eventually cater to developers. Eight years ago, Bitcoin was conceived as a virtual currency that removed the need for centralized financial systems. Initially, developers actually tried building applications upon the Bitcoin blockchain by storing data in the blockchain itself, but it turned out to be pretty inefficient (as described in another old Joel post!). One of these developers, Vitalik Buterin, was frustrated by Bitcoin’s immobilism and risk averse culture for adopting new developer-friendly features. So, he built his own platform, Ethereum.

While Bitcoin was originally intended to serve as a new medium for financial store of value, Ethereum was invented to serve as a Turing complete developer environment. In Ethereum, developers write smart contracts in the Solidity programming language, and those smart contracts are run in the Ethereum Virtual Machine (EVM). Here, we observe an opportunity for developers to fork and implement their own blockchains to serve different purposes. To do so, however, would require rekindling developer support and network effects that existing blockchain technologies had previously achieved. Today, building on top of existing networks like Ethereum allows developers to become stakeholders in not only their own applications, but also the underlying protocol.

Dapps, App Coins, and Smart Contracts

Today’s blockchain developers often build decentralized applications, or dapps, on top of existing protocols to address specific markets and end users. In doing so, developers can issue tokens, or app coins, that are used to execute certain “functions” of the dapps themselves, not unlike Chuck-E-Cheese tokens are used for specific purposes like skeeball. These “functions” are the “smart contracts” that promise a dapp’s services in return for a digital asset, thereby removing the need for a middle-man to ensure the transaction. In other words, smart contracts promise that for one Chuck-E-Cheese token, you can exchange one game of skeeball.

As the functionality of the dapp becomes more sought after, the fixed number of app coins increase in value as a function of supply and demand. In other words, if it turns out that the Chuck-E-Cheese experience is truly remarkable and highly-demanded, the fixed supply of tokens become more valuable. This is the underlying principle that informs all ICOs (initial coin offerings), in which dapp developers solicit investment by offering app coins in return for capital to fund their projects.

But wait, you might ask, “Why not use an existing token as opposed to issuing your own, dapp-specific token in the first place?” Dapp-specific app coins enable small-scale economies that facilitate the application’s purpose. These tokens serve as scarce resources that can be regulated and governed to more closely align with the functionality of a dapp. This is where Ethereum comes back into the picture — with Ethereum, developers can very easily issue their own tokens for the specified use of their own dapps.

Early Opportunities

With an understanding of the underlying mechanisms of dapps, it’s important to think carefully about how decentralization would benefit your end users. Rather than jumping into a list of side projects, swapping relational databases for blockchain implementations, we urge you to consider the benefits of decentralization. For instance, Augur creates prediction markets by relying on decentralized participants to make correct predictions because they share financial incentives.

At a meta-level, there are also opportunities for innovation in the developer stack. Many blockchain developers liken the maturity of the blockchain tools and frameworks to those of the web during early days of the Internet. We spoke to Ben Yu of Stream, who described this as a new opportunity for developers: “There is extremely low-hanging fruit in making the field more accessible, and a lot of technical infrastructure needs to be built up to bring blockchain from 1994, in internet terms, to 2017.”

With the innovation of the blockchain, many have identified the opportunity to build a new, decentralized web stack that does not depend on centralized government or corporate entities. The traditional web stack is composed of building blocks like TCP/IP, DNS, databases, web servers, authentication systems and CDNs, and we are in the midst of replicating these components by using platforms like Ethereum as the base layer.

Challenges of Immutability

Unfortunately, a technology that is likened to the early iterations of JavaScript almost certainly comes with challenges, the most apparent of which is related to the immutability of new protocols. Developers cannot change the underlying blockchain or higher-level smart contracts. Libraries or contracts cannot be easily versioned. The recent Parity bug that locked 150MM USD in funds, among many other similar incidents, reminds us of the urgent need to build “future-proof” architectures.

Brandon Millman, an engineer at 0x, described how blockchain immutability affects the way he thinks about security concerns: “Being in this space means being a lot more careful, especially because people’s money is at risk. Part of the benefit of the blockchain paradigm is that if you’re holding onto your private key, it’s hard for people to take money from you, but a lot of scams are getting you to willingly send your money to the wrong place instead of reaching in to steal money from your wallet.”

Developers, especially those accustomed to the fast pace of the startup world, are forced to consider tradeoffs between speed and security. As Ben Yu of Stream describes, “You have to move extremely fast, because the space is going enormously fast, but you can’t move fast and break things, which is the traditional philosophy for development being done now. If you break things, you lose hundreds of millions of dollars.”

Building on the blockchain requires a different level of planning. Developers can no longer apply hot-fixes or overnight patches, because they no longer have centralized control over entire systems. Instead, introducing system changes often involves hard forking entire protocols, or in some cases, providing separate sources for protocol parameters that aren’t tied directly into the blockchain.

Ethereum’s Limitations

Beyond the general challenges of immutability, Ethereum includes several limitations that blockchain developers might encounter. For one, Ethereum is unable to access real time data from outside the blockchain. Developers need to rely on trusted third party data providers, called oracles, to provide smart contracts with outside information like weather, random numbers, or currency values.

Moreover, Ethereum’s specification prevents real-time computations. Processing of block transactions takes upwards of 15 seconds (which is lightning fast compared to Bitcoin’s 10 minutes). As a result, developers need to write asynchronous code with front-end frameworks that can update states accordingly (like React).

With Ethereum, you are also tied to paying for your transactions by the operation with gas that translates into Ethereum’s ether. As a result, using the current version of Solidity, you could very feasibly find yourself hitting a transaction limit if the computation you intend to perform is too expensive (like verifying checkmate in a game of chess). As a result, on-chain computations because become costly in terms of money and network bandwidth. There are interesting alternatives like Truebit to perform more intensive computation off-chain.

Getting Started

In general, it can certainly feel overwhelming getting into this space. It’s an interdisciplinary field, spanning domains of economics, game theory, finance, computer science, math, cryptography, and more. However, that also means that there’s a lot of surface area to contribute.

Brandon of 0x recommends diving into areas where you have some interest or experience instead of trying to learn everything at once: “If you’ve done JS development beforehand, there are a lot of JS libraries that you can contribute to. While you will definitely need to know [how everything fits together] eventually, you don’t need to feel like you need to take an entire course initially.”

In the spirit of decentralization, most of the code for projects on the blockchain are also available through open-source. There are a number of good resources to get your hands dirty:

In addition, the developer communities are remarkably receptive and helpful. Check out:

If you learn primarily by coding up your own projects, here are some ideas to get started:

  • Build your own wallet. It can be a be a web, mobile app or desktop app.
  • Create your own ERC-20 token and deploy it on the test net.
  • Modify crypto kitties (dogs, tanks, zombies…) and deploy it on the test net.

Looking Forward

In its current state, yes, blockchain development is messy. No, there aren’t clean frameworks and tools analogous to those that exist for modern web development. But why not see the blockchain’s nascent state as an opportunity to impact a paradigm-shifting technology?

On the blockchain, you don’t need to deploy any centralized servers, which means that there’s no single point of failure. If your whole stack is decentralized, there is no trusted third party involved making it censorship resistant, and your database is publicly verifiable. As the new paradigm offers opportunity to publicly share data, we observe a supreme advantage to decentralizing databases. This is the future we’re building towards on the Blockchain— where information and power are distributed systematically by cutting out the middleman.

Comment on Hacker News..

Thanks to Ben Yu (Stream) and Brandon Millman (0x) for lending their time to be interviewed, and thanks to Niharika Bedekar, Craig Cannon, Claire Shu for reading drafts of this post.

本文转载自:http://blog.ycombinator.com/building-for-the-blockchain/

openthings

openthings

粉丝 335
博文 1176
码字总数 867375
作品 1
东城
架构师
私信 提问
西湾区块链:区块链在环境保护中的 8 大致胜法则

世界经济论坛基金会(WEF) 9月 14 日发布名为《为更美好的地球构建区块链》(Building Block(chain)s for a Better Planet ) 的研究报告。报告中阐述了超过 65 个区块链技术在环境保护方面的使...

西湾区块链
2018/09/19
0
0
基于Java语言构建区块链(一)—— 基本原型

最终内容请以原文为准:https://wangwei.one/posts/df195d9.html 引言 区块链技术是一项比人工智能更具革命性的技术,人工智能只是提高了人类的生产力,而区块链则将改变人类社会的生产关系,...

王维_hz
2018/04/17
0
0
Go实现区块链(三)---存储与命令

1.前言 到目前为止我们了解区块链的数据结构以及简易版的挖矿(pow共识机制)。接下来我们将一起了解区块链的存储,注意:区块链本质上一款分布式数据库,这里不实现分布式,我们这先了解区块...

even_366
2018/03/16
0
0
开发者的以太坊进阶指南 | Jeth 以太坊系列线下活动第四期北京场

入群与讲师讨论 介绍 Jeth 以太坊系列线下活动:《开发者的以太坊进阶指南》北京站来了! Jeth 是由掘金技术社区主办,以太坊社区基金会、以太坊爱好者与 ConsenSys 协办,围绕以太坊技术开发...

掘金
2018/11/06
57
0
开发者的以太坊进阶指南 | Jeth 以太坊系列线下活动第四期北京场

入群与讲师讨论 介绍 Jeth 以太坊系列线下活动:《开发者的以太坊进阶指南》北京站来了! Jeth 是由掘金技术社区主办,以太坊社区基金会、以太坊爱好者与 ConsenSys 协办,围绕以太坊技术开发...

掘金
2018/11/06
27
0

没有更多内容

加载失败,请刷新页面

加载更多

如何使用Selenium WebDriver截屏

有谁知道是否可以使用Selenium WebDriver截屏? (注:不是硒RC) #1楼 吉顿 import org.openqa.selenium.OutputType as OutputTypeimport org.apache.commons.io.FileUtils as FileUtils......

技术盛宴
26分钟前
4
0
高阶函数

定义:能够包装函数的,使原本函数增加一些额外的福利的函数 比如: function higherOrderFn(fn){} 能够对fn增加一些额外的福利 应用场景: (function () { var getLogin = functio...

gtandsn
31分钟前
9
0
架构师成长之后

小致Daddy
33分钟前
6
0
Git 介绍和日常命令

git 介绍 GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub。 GitHub于2008年4月10日正式上线,除了Git代码仓库托管及基本的 Web管理...

郭靖Michael
今天
9
0
技巧以管理R会话中的可用内存

人们使用什么技巧来管理交互式R会话的可用内存? 我使用下面的函数(基于Petr Pikal和David Hinds在2004年r-help列表中的发布)列出(和/或排序)最大的对象,并偶尔对其中一些对象进行rm() ...

javail
今天
6
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部