Bitcoin, developed by Satoshi Nakamoto in 2009, is hailed as a revolutionary development in digital assets and currency. While the focus is often on Bitcoin as a currency, the real innovation is the underlying blockchain technology that powers it. This technology has numerous potential applications, including the creation of digital assets, physical device ownership, and complex systems controlled by code.
Ethereum, a next-generation smart contract and decentralized application platform, aims to build on this technology by providing a blockchain with a built-in programming language that enables the creation of smart contracts and decentralized applications. This platform will allow users to create an endless range of systems with just a few lines of code.
Introduction to Bitcoin and Existing Concepts
History and Bitcoin as A State Transition System
The concept of decentralized digital currency has been around for decades, but it wasn’t until 2009 that the idea was finally put into practice with the creation of Bitcoin by Satoshi Nakamoto.
Bitcoin operates using a proof-of-work consensus algorithm, allowing nodes in the network to collectively agree on a set of updates to the state of the Bitcoin ledger. The ledger of a cryptocurrency can be thought of as a state transition system, where the “state” is the ownership status of all existing coins and the “state transition function” updates the state based on transactions.
A transaction contains inputs with references to existing unspent transaction outputs and outputs creating new unspent transaction outputs. The state transition function enforces the ownership and conservation of value, preventing transaction senders from spending non-existent or other people’s coins and ensuring the sum of the denominations of all inputs is equal to the sum of the denominations of all outputs.
In order to use Bitcoin for payment, a person must find a set of available unspent transaction outputs that they own and create a transaction with those inputs and the desired outputs.
Mining
In Bitcoin, the state transaction system must be combined with a consensus system to ensure that everyone agrees on the order of transactions in a decentralized currency system. This is accomplished through a process called mining, where nodes in the network continuously attempt to produce packages of transactions called “blocks”. Each block contains a timestamp, a nonce, a reference to the previous block, and a list of transactions. Over time, this creates a blockchain that represents the current state of the Bitcoin ledger.
To determine if a block is valid, the algorithm checks if the previous block referenced by the block exists and is valid, the timestamp is within 2 hours into the future, and the proof-of-work on the block is valid. The proof-of-work requires the double-SHA256 hash of every block to be less than a dynamically adjusted target, making block creation computationally difficult and preventing sybil attackers from altering the blockchain.
In the event of a malicious attacker, the attacker will target the order of transactions since it is not protected by cryptography. The attacker’s strategy is to send 100 BTC to a merchant, wait for delivery of the product, and then produce another transaction sending the same 100 BTC to himself. The attacker tries to convince the network that his transaction to himself was the one that came first. However, the network’s consensus system and mining process prevent this from happening. The miner of every block is entitled to include a transaction giving themselves 25 BTC as a reward for their computational work and any difference in inputs and outputs of a transaction goes to the miner as a transaction fee.
Overall, the mining process in Bitcoin ensures the security and validity of the blockchain by making block creation computationally difficult and preventing malicious attackers from altering the order of transactions.
Alternative Blockchain Applications
The idea of taking the underlying blockchain idea and applying it to other concepts also has a long history.
Namecoin: One of the most prominent alternative blockchain applications is Namecoin, which was created in 2010. Namecoin is a decentralized name registration database that allows for the creation of user-friendly identities rather than pseudorandom hashes like 1LW79wp5ZBqaHW1jL5TCiBCrhQYtHagUWy, which are used in protocols such as Tor, Bitcoin, and BitMessage. The first-to-file paradigm in Namecoin ensures that only the first registerer succeeds in registering a specific name, making it a perfect fit for the Bitcoin consensus protocol.
Colored coins: Another alternative blockchain application is colored coins, which allows users to create their own digital currencies or digital tokens on the Bitcoin blockchain. In the colored coins protocol, a new currency is issued by publicly assigning a color to a specific Bitcoin UTXO1(Unspent Transaction Output), and the color of other UTXO is defined recursively as the color of the inputs spent in the transaction that creates them. This enables users to maintain wallets containing only UTXO of a specific color and transfer them around just like regular bitcoins.
Metacoins: Metacoins are another application that work on top of the Bitcoin blockchain. The metacoin protocol uses Bitcoin transactions to store metacoin transactions but has a different state transition function. A rule is added in metacoins that if the state transition function returns an error, it defaults to maintaining the current state. This makes it easy to create a cryptocurrency protocol with advanced features that cannot be implemented within Bitcoin, but at a low development cost since the complexities of mining and networking are already handled by the Bitcoin protocol.
There are two general approaches to building a consensus protocol: building an independent network or building a protocol on top of Bitcoin. The former approach is difficult to implement as it requires bootstrapping an independent blockchain and building and testing all the necessary state transition and networking code. On the other hand, the latter approach, which is based on Bitcoin, does not inherit the simplified payment verification features of Bitcoin, making it vulnerable to security threats.
Scripting
Even without any extensions, the Bitcoin protocol does have a weak version of smart contracts. UTXO in Bitcoin can be owned by either a public key or a more complicated script expressed in a stack-based programming language. A transaction that spends this UTXO must provide data that satisfies the script. For example, a script can be created that requires signatures from two out of three private keys to validate, making it useful for multisig setups.
The scripting language in Bitcoin is limited, but it has been used to implement various use cases, such as multisig, time-locked transactions, and escrow transactions. The simplicity and limited capabilities of the Bitcoin scripting language have led to the development of more advanced scripting languages, such as Ethereum’s Solidity, which allow for the creation of complex smart contracts.
Despite the success of alternative blockchain applications, building an independent network can be difficult and time-consuming, while building a protocol on top of Bitcoin can result in security weaknesses as it does not inherit the simplified payment verification features of Bitcoin. Thus, there is a need for a better solution that balances the advantages and drawbacks of both approaches.
To be continued…
- An unspent transaction output (UTXO) is the technical term for the amount of digital currency that remains after a cryptocurrency transaction.