Ethereum White Paper Explained. Part 3

Ethereum White Paper, Explained. Part 1 & Part 2 aimed to help you understand how the Ethereum ecosystem works, now let us delve into the applications of the Ethereum Platform.

Ethereum has three main applications.

  • Financial Applications

These include currencies, derivatives, contracts, wallets, wills and could even include employment contracts.

  • Semi-Financial Applications

This category involves partial inclusion of money along with a non-monetary aspect. An example would be automatic bounties on finding solutions to computational problems.

  • Governance

Online voting is a possible use case for the Ethereum ecosystem.

 

Token Systems

Tokens have numerous use cases for sub-currencies such as USD, gold, equity, property, coupons and even tokens with no conventional means of value which might be used for incentives. Token systems are quite easy to be implemented on the Ethereum platform. The logistics involved on how the tokens work is well explained in Part 1 & Part 2. The ledger subtracts units from one account and enters units into another.

You can find the basic code implemented in Serpent below:

def send(to, value):
if self.storage[msg.sender] >= value:
self.storage[msg.sender] = self.storage[msg.sender] – value
self.storage[to] = self.storage[to] + value

This is an implementation of a state transition function that works as a banking system. You enter a few lines of code to program conditions of how the currency units are distributed or for numerous other use cases.

 

Financial Derivatives and Stable-Value Currencies

Financial derivatives are one of the most common applications of smart contracts. They are quite easy to be implemented in code as well. One challenge here is implementing contracts that can refer an external price ticker.

Consider the following example:

A smart contract that hedges against the volatility of ETH with USD as the base currency. This application, however, requires one to know the value of ETH/USD traded on an exchange. This can be done by a data feed that is maintained by a third party designed such that the third party can update the price of the contract as and when needed. Other contracts can ping the data feed and get back a response that provides the price.

The contract would look as mentioned in the Ethereum white paper and is pretty much self-explanatory.

  1. Wait for party A to input 1000 ether.
  2. Wait for party B to input 1000 ether.
  3. Record the USD value of 1000 ether, calculated by querying the data feed contract, in storage, say this is $x.
  4. After 30 days, allow A or B to “reactivate” the contract in order to send $x worth of ether (calculated by querying the data feed contract again to get the new price) to A and the rest to B.

Such contracts have high impact use cases in crypto-commerce. Most users stay away from cryptocurrency due its high volatility. Users want the security and convenience of cryptocurrencies, however, the idea of losing 10%-20% of value in a single day is unpleasant. The most common solution used up until now are issuer-backed assets. The idea involves creating a sub-currency that they hold the right to issue, revoke and provide units of the currency to a seller who provides them with one unit of another asset. For example, these assets could be Gold or USD. Although they can be modified to accept a vast number of assets as well. The issuer then exchanges one unit of the sub-currency to one defined unit of the physical asset. This allows numerous different assets to be converted into cryptographic assets and exchanged for value. However, it all depends on the trust and reliability on the issuer.

Cryptographic financial derivatives act as our knight in shining armor in this scenario. They provide an alternative. Instead of a single issuer, we can use a market of traders betting on the price of a decentralised asset like ETH. Speculators do not default while trading as the smart contract holds their funds in escrow. However, this source is not fully decentralised, as we rely on a third-party source to provide the price of ETH. This is still a major improvement and reduces the potential for fraud when compared to issuers that cannot be trusted.

 

Identity and Reputation Systems

Namecoin was one of the first alternative cryptocurrencies that tried to use a Blockchain similar to Bitcoin to provide a name registration system. This allowed users to register their names in a public database with other data. Other use cases include mapping domain names to an IP Address, email authentication and advanced reputation systems.

The following code is for a Namecoin like registration system on the Ethereum network:

def register(name, value):
if !self.storage[name]:
self.storage[name] = value

The smart contract programs a simple database inside the Ethereum network where data can be added, but not modified or removed. Thus, maintaining the immutability feature of the Ethereum platform. Any registration made against a name with some value will be stored on the blockchain forever. A sophisticated program may allow other smart contracts to query and fetch data from it, it may also allow the owner to change or transfer ownership.

 

Decentralised File Storage

There are numerous popular online storage services. Services like Dropbox, Google Drive let you upload a backup of your hard drive on to their centralised servers for a monthly fee. Sure, they have a free storage facility up to a certain size limit, but most the data that we need to store on the cloud exceeds this free storage. Ethereum contracts provide a much better tradeoff for developing decentralised file storage ecosystems, where users can earn money by renting out the free space on their own hard drives.

An example of such a contract on the Ethereum network would work as follows:

  1. Data is split into blocks, encrypted and a Merkle tree is built.
  2. Every N blocks, the contract picks a random index in the Merkle tree, then gives some ether to the first entity to supply a transaction with a simplified payment verification; like proof of ownership of the block at that index, in the Merkle tree.
  3. If the user wants to download their file, they may use a micropayment protocol. This can  be as low as 1 szabo per 32 Kilobytes.
  4. To pay less gas fees, the payer would replace the transaction at the end of 32 Kilobytes with a slightly more lucrative one in order to fetch more data.

It might seem like trust is distributed among random nodes so that the file is not forgotten, but this risk can be reduced by splitting the file into many pieces and watching the contracts to check if each piece is still in some node’s possession. If there is enough ether in the contract and it is still paying out money, that is enough proof that the file is still stored somewhere according to the programmed protocol.

 

Decentralised Autonomous Organizations

The concept behind a DAO (“Decentralized Autonomous Organization”) is that a certain set of members or shareholders, perhaps with a 67% majority, may spend the funds of the entity and modify its code. Members will come to a collective decision on how to allocate the funds of the organization. This may range from bounties, salaries, to even more complex mechanisms like rewarding internal work. It tries to replicate the functioning of a company by using only Blockchain technology as the solution. Most discussion surrounding DAOs has focused on the capitalist model of a DAC (Decentralized Autonomous Corporation) with shareholders who receive dividends. An ideal alternative, however, is a Decentralised Autonomous Community where all members have a share in decision making and where they require at least 67% of existing members to add or remove a member.

Following is a general outline of how to code a DAO. A simple design is a piece of code that can modify itself when two thirds of members agree on a change. The code is immutable, however, there is a work around. Code can be divided into separate contracts having de-facto mutability and the addresses of each contract can be stored in mutable storage. This would allow us to mix and match code from smart contracts in order to change the code. There would be three transaction types as mentioned in the Ethereum White Paper:

  • [0,i,K,V] to register a proposal with index i is to change the address at storage index K to value V
  • [1,i] to register a vote in favor of proposal i
  • [2,i] to finalise proposal i if enough votes have been made

The contract would store clauses for each of these. It would maintain a repository of all open storage changes along with the list of people who voted for them. This would accompany a list of all members. Whenever a storage change would get the bare minimum of the members voting for it, a final transaction would execute the change. Further sophisticated features would include built in voting ability for sending transactions, adding/removing members, delegation of votes, etc. This would let DAOs grow as a decentralised community.

 

Further Applications

There are numerous applications on the Blockchain and following are a few instances:

  • Savings Wallets

Alice wants to keep her funds safe but worries that someone might hack her private key, or she might lose it. She transfers ether into a contract with Bob who will act as a bank in this scenario.

  • Alice alone can withdraw a maximum of 1% of the funds per day.
  • Bob alone can withdraw a maximum of 1% of the funds per day, but Alice can make a transaction with her key, shutting off this ability.
  • Alice and Bob together can withdraw anything.

Normally, 1% per day is enough for Alice, and if Alice wants to withdraw more she can contact Bob for help. If Alice’s key gets hacked, she runs to Bob to move the funds to a new contract. If she loses her key, Bob will get the funds out eventually. If Bob turns out to be malicious, then she can turn off his ability to withdraw.

Such conditions can easily be programmed into an Ethereum smart contract.

 

  • Crop Insurance

A Financial Derivatives contract can be made using a data feed of the weather instead of a price index. A farmer purchases a derivative that pays out inversely based on the precipitation in any selected area. If there is a drought, the farmer gets paid and if there is rain, crops will do well which implies the farmers business is safe. Farmers can essentially hedge their businesses. This use case can be expanded to natural disaster insurance as well.

 

  • Decentralised Data Feed

There is a protocol called ShellingCoin that lets you decentralise data.

The working of SheelingCoin is mentioned below:

N number of parties enter the value of ETH/USD in a system and everyone between the 25th and 75th percentile get rewarded with a token. This way, any person will only get the incentive if they give the answer that everyone else provides. Theoretically, this protocol can create any number of values.

 

  • Smart Multisig Escrow

Multi signature transaction contracts are where, for example, at least 2 out of 3 keys are mandatory to spend the funds. On the Ethereum platform a lot of more complex conditions can be programmed. Being a Turing complete language, the programming capabilities of Ethereum are limitless.

 

  • Cloud Computing

Ethereum can also be used to create a computing environment, which will allow users to carry computations on other systems on the Ethereum Blockchain, optionally also asking for proofs for computations done at random checkpoints. This allows creation of a Cloud Computing market where anyone can participate. This kind of computing, however, is not suitable and recommended for all tasks

 

  • P2P Gambling

Peer to Peer Gambling protocols can be implemented on the Ethereum Blockchain. There are numerous Ethereum gambling websites that are already exist.

 

  • Prediction Markets

Prediction markets are also easy to implement. They allow you to bet on the prediction of a certain outcome and which is then verified on the Blockchain and those who predict correctly are rewarded.

 

  • On-Chain Decentralised Marketplaces

Such marketplaces use identity and reputation systems as a base.

 

This concludes the third part of the Ethereum White Paper series. Stay tuned for more updates on the BBOD and follow us on Twitter.

Bitcoin Scarcity: Perception Vs. Reality

Earlier this year the press flooded the internet with articles stating that only 20% of total Bitcoins remained to be mined, causing a frenzy of fear of missing out for those who were not already invested. They were correct, 80% of the total fixed supply of 21 million Bitcoins set by mysterious Satoshi Nakamoto was now accounted for, with the 16.8 millionth transaction occurring on the 13th of January 2018. Despite this, many news outlets failed to convey how that, with time, Bitcoins would become increasingly more difficult to mine as a result of minings inherent complexity and the diminishing reward scheme over time. As a result, many have suggested that a vague approximation of the last Bitcoin block to be mined will take place in 2140. This article aims to ensure that market participants are aware of the facts surrounding Bitcoins fixed supply, the evolution of mining Bitcoin and how scarcity, or the perception of it, could affect demand in the future.

Bitcoins 21 Million Hard Cap

Unlike in traditional nation-state economies, Bitcoin operates in an entirely decentralised manner with a fixed supply. Whereas a central bank usually issues currency as they wish – according to the growth of the number of goods which are being exchanged in the economy (commonly known as Quantitative Easing). Bitcoin is produced at a predetermined rate defined by the initial algorithm that was implemented by its anonymous creator. The algorithm has set rules which cannot be altered. As such, how the currency is created and at what rate was inherently finalised at inception. Hence, one can be certain that only 21 million Bitcoins will ever be created.

The certainty of the fixed supply of 21 million Bitcoins can be explained as follows. Bitcoins are created every time a miner discovers a new block. Since the first block on the Bitcoin Blockchain was created (otherwise known as the Genesis Block), the rate that blocks have been mined has adjusted every 2016 blocks in order to maintain a two week adjustment period, as six blocks are created per hour. The total number of Bitcoins generated per block is predefined to decrease every 210,000 blocks by half, equating to approximately four years. These predetermined conditions mean that the rate of new Bitcoin created exponentially slows down over time and ensures that no more than 21 million Bitcoins will ever be created.

(Source: Controlled Supply: Timeline Estimation)

 

The intentional decreasing supply algorithm was chosen in order to introduce the concept of digital scarcity to the cryptocurrency. Certain individuals compare Bitcoins scarce attributes to precious metals such as Gold. For instance, as time passes large quantities of Gold are becoming increasingly impossible to find without large-scale investment. This process continues until the cost of sourcing Gold almost outweighs its market value. Capturing this phenomenon in the digital sphere is no easy feat and thus scarcity is one of the defining characteristics of Bitcoin. It should be noted that the concept of scarcity is not widely seen in the cryptocurrency marketplace, projects like Ripple, Nem and Lisk released all coins into the market at once.

The Evolution of Bitcoin Mining

To continue the analogy of Gold, in order to obtain the raw material huge amounts of physical effort must be expended to mine the scarce asset. In Bitcoin, this equates to the large amount of computational power which is necessary to solve extremely complex mathematical problems in order for a new block to be created. Hence, those who endeavour to solve such challenges are coined ‘miners’.

As discussed previously, every 210,000 blocks miners receive half the reward for solving a new block. When Bitcoin was originally created in 2009, miners received an astonishing 50 BTC for solving a block as a reward for being innovators within the space, albeit with much easier equations to solve. For instance, when Bitcoin was first released in 2009, an average retail computer would have been able to mine approximately 200 BTC in a few days. Nowadays, it would take the same computer 98 years to mine just 1 BTC. As a result, such mining is not as available to retail clients as it was previously. Instead, more industrial institutions have moved into the market with Application Specific Integrated Circuit (ASIC) computer configurations to maximise the amount mined. This truly displays the exponential increase in difficulty in a relatively short space of time.

(Source: Controlled Supply)

Today, miners receive 12.5 BTC as a reward for solving a new block. The next ‘halving’ event is expected to take place in 2020. As this process unfolds, miners will receive less and less reward for the blocks they create whilst the equations they need to solve will become increasingly complex, thus requiring much more computational effort and expense. This intentional paradox implemented by Satoshi ensures that the supply of coins cannot rise too quickly. As previously stated, the last block will be mined in approximately 2140. Consequently, with Bitcoins supply remaining constrained until 2140 and demand likely continuing to rise, as a result of Bitcoins scarcity amongst numerous other factors, the value of Bitcoin is almost certain to increase exponentially over time. This ensures that Bitcoin is an excellent store of value, once again similar to Gold.

How Scarcity Affects Demand

Undoubtedly, scarcity has had a great impact on the demand for Bitcoin and this will feed into the self-perpetuating snowball effect as time goes on and supply continues to decrease. As with any limited supplied asset, when the underlying resource becomes harder to source, the scarcity of supply causes significant demand for the market when the asset is perceived to have value. As previously suggested and widely acknowledged, Bitcoin is now viewed as a desirable store of value comparable to Gold. Thus, with only 21 million Bitcoins ever to be created, the market shows, or certainly will in the future, a significant gap between the number of individuals who wish to purchase the asset and the amount available. As this process unfolds, digital scarcity will make Bitcoin exponentially more valuable over time.

To further perpetuate this, individuals perception of Bitcoin scarcity over the actual reality will only increase the rate of adoption. It won’t be long until we see headline articles stating that only 15% of all Bitcoins ever to be created have been already been mined. No doubt the masses will hoard the asset once more, before they feel it is too late. The fact of the matter is, as displayed in this article, the supply of Bitcoin rapidly slows down with time, as the complexity of solving blocks becomes increasingly difficult and miners are rewarded less. Bitcoin will continue to be mined until the approximate year of 2140. Hence, there is still plenty of time to invest. As Bitcoin continues to be recognised as a store of value and understood and adopted by the layman, one may wish they invested sooner rather than later.

Conclusion

This article has aimed to bridge the gap between one’s perception of the scarcity of Bitcoin and the actual reality of the matter. There is no denying that the majority of Bitcoins have already been mined, yet the excellence of the mysterious creators’ code ensures that supply cannot be created too quickly. This inherent attribute makes Bitcoin an excellent store of value, akin to Gold, yet in the digital sphere. Something truly pioneering and unique in our digital world. Instead of investing for the fear of missing out, perhaps we should marvel in the astonishing technology behind the project itself. Either way, one can be certain that the price of Bitcoin will increase as its supply slowly decreases whilst people perceptions remain unchanged.

Check out the BBOD Research Blog for more similar articles.

Bitcoin ETF Proposals Possess Substantial Market Influence

gold-colored Bitcoin on book

Before July, one could be forgiven for being confused by the prospect of a Bitcoin ETF being introduced into the cryptocurrency ecosystem. Almost three months on, however, such ETFs have become synonymous with the term Bitcoin. To claim naivety of the ETF proposals at this stage risks entirely misinterpreting current market conditions. This article aims to ensure market participants are completely aware of the facts thus far including what exactly a Bitcoin ETF entails, when they are likely to be implemented and how they will impact the overall market.

 

ETFs Defined

Exchange-traded funds, commonly known as ETFs, are a traditional investment vehicle offered on all major stock exchanges around the globe. The most notorious example of such a fund is the well-regarded S&P 500 on the New York Stock Exchange (NYSE). They allow exposure to an underlying asset or basket of assets offered in the form of a security that is proportionally represented by the funds’ shares. Most importantly, they allow exposure to a market without needing to physically hold or store the underlying asset, which is left up to the fund. For many years now, ETFs have become one of the key mainstream methods for passive investment by the masses in mainstream markets, as they are commonly associated with lower investment risks than individual stocks.

Indeed, as ETFs allow an individual to buy a basket of multiple assets, they mitigate strong price swings which individual stocks often suffer from, especially in the incredibly volatile cryptocurrency market. Any losses from assets which do not meet up to their promise are counterbalanced with assets which have performed particularly well and the growth of the overall industry during that period. Driving up the funds share price over time. The notorious investment tycoon Warren Buffett once proved the power of ETFs with a successful bet that the S&P 500 would outperform a collection of well-regarded Wall Street hedge funds over the period of a decade. His victory truly displayed to the masses the power of such funds.

 

Bitcoin ETFs Market Impact

One of the major barriers to mainstream cash inflow into the blockchain ecosystem has been the lack of institutional investors ability to purchase assets using traditional methods. Many do not understand that such market participants are simply not going to risk their hard-earned capital on unfamiliar and unregulated cryptocurrency exchanges, there is simply too much at stake. Instead, institutional money will enter the space once they can acquire cryptocurrencies without needing to hold the underlying asset, in a highly regulated and fully insured manner. Thus, for institutional investors crypto ETFs mitigate the risks of the industry whilst allowing them to profit from one of the greatest financial revolutions one will likely see in their lifetimes. Make no mistake, institutional investors want to get involved in the ongoing revolution, they simply want to do so in a highly regulated and safe fashion.

Although the impact of such institutional investors on the market will likely be of a speculatory nature in the first instance, this huge influx of money to the market will bring much-needed market exposure. The media love to shame the cryptocurrency ecosystem as much as feasibly possible, calling it a scam or a fad on a regular basis. Such institutional money would bring credibility to the entire industry and allow well-respected entities who have been quietly investing in the cryptocurrency space to come out of the woodwork and into the spotlight. Ultimately this could lead to mainstream cryptocurrency adoption long term, as a result of the perceived integrity of the industry as a whole.

 

Bitcoin ETF Calendar

Issuer Company Filing Date Status SEC Date
“Physically” Backed by Bitcoin Holdings
Winklevoss Bitcoin Shares Winklevoss Cap Mgmt 01/07/13 Denied 26/07/18
VanEck SolidX Bitcoin Trust VanEck & SolidX 05/06/18 Postponed 30/09/18
Bitwise HOLD 10 Cryptocurrency Index Fund Bitwise 24/07/18 Awaiting Approval Unknown
Derivatives Based
GraniteShares Bitcoin ETF GraniteShares 15/12/17 Denied 15/09/18
GraniteShares Short Bitcoin ETF GraniteShares 15/12/17 Denied 15/09/18
Direxion Daily Bitcoin 1.25X Bull Direxion 05/01/18 Denied 21/09/18
Direxion Daily Bitcoin 1.5X Bull Direxion 05/01/18 Denied 21/09/18
Direxion Daily Bitcoin 2X Bull Direxion 05/01/18 Denied 21/09/18
Direxion Daily Bitcoin 1X Bear Direxion 05/01/18 Denied 21/09/18
Direxion Daily Bitcoin 2X Bear Direxion 05/01/18 Denied 21/09/18
Evolve Bitcoin ETF Evolve Funds 21/09/17 Awaiting Approval Unknown

The table above displays cryptocurrency ETFs which are currently laying the foundations for their approval. Such firms are on a waiting list ready for their hearing with the U.S. Securities and Exchange Commission (SEC), who will ultimately determine their fate. The notorious Winklevoss twins fund has already been turned down for the second time as of the 26th of July. Following this, the SEC has denied a following 9 applications, predominantly from Derivatives based ETFs such as GraniteShares and Direxion. Such a decision results from their perceived inability to provide significant liquidity due to their market size, which could lead to significant market manipulation.  

Despite such dismissals, the most important ETF which market participants should be fully aware of is the VanEck SolidX Bitcoin Trust who plan to release their ‘physically’ backed ETF on the notorious Chicago Board of Options Exchange (CBOE). Recently, the SEC hearing date was postponed to the 30th of September. The CBOE has true industry influence as the largest options exchange in the world and have proven themselves in the cryptocurrency market by introducing their Bitcoin futures market in late 2017. They have meticulously studied the failures of all previous ETF denials and reviewed their application accordingly. If an ETF is likely to get approved this year, this will most likely be the one.

Despite all the hype, some sceptics suggest that ETF delays are usual, with Copper being the last ETF to pass through the SEC. With their reasoning, the likelihood of an ETF being approved in 2018 is minimal. However, regardless of whether a decision happens in the next few months or not, the market has certainly been responding rapidly to both positive and negative news. The first Winklevoss twins ETF denial news caused a flash crash which quickly corrected, whilst the delay of the major CBOE proposal caused a more prolonged fall in Bitcoins valuation. Ultimately, the market appears to be in a stalemate until a further delay, approval or disapproval occurs. The latter would likely cause a long-term downtrend, whilst an approval could see prices increase exponentially. As the 30th of September looms, the market tension builds. Be sure to have a plan for all situations to ensure one maximises or minimises the ETFs impact.

 

Centralisation Undermines The Most Fundamental Principle Of Blockchain Technology

airport-bank-board-534216.jpg

 

Blockchain technology promised users the ability to become their own bank, yet the majority of exchanges which allow individuals to purchase cryptocurrencies are entirely centralised.

This is a fundamental problem plaguing the industry currently, with centralised exchange hacks occurring on a far too frequent basis. For example, the colossal Mt. Gox hack of 850,000 BTC, Bitfinex’s loss of 120,000 BTC and more recently the Bithumb breach, the 5th largest exchange by volume at the time. Such events indicate that no matter how established the exchange, there is always a possibility of being infiltrated by hackers, after all this may be the most profitable heists of all time, as Bitcoin continues to increase in value.

The problem here is simple, just like with traditional institutions, all of your money is held in one or several accounts, which can easily be targeted by hackers to great effect. A single point of failure.

Whilst traditional firms have heavy measures in place to avoid such attacks, they are still vulnerable. Yet at least such firms provide consumers with reassurance, if your funds are stolen, they will be replaced. This is not the case with the majority of cryptocurrency exchanges, someone hacks the exchange, you lose your entire account. Will you get refunded? Maybe. When? Who knows.

Surely there must be a solution to such a problem, after all, can you really call yourself a proponent of blockchain technology when you may as well be handing over your precious money to a central bank. Let us consider our options.

 

How Fully Decentralised Exchanges Work Using Blockchain Technology

 

THE IDEAL

Dissimilar to centralised exchanges, decentralised exchanges are not controlled by one single entity. Instead, they are distributed over the entire Blockchain network that they utilise. This ensures that a decentralised exchange does not possess any of their customers’ funds or information and so are impossible to hack or shut down. They simply match trade orders for consumers by utilising a certain blockchains smart contract system. Thus, entirely decentralised exchanges live up to the libertarian promise of a free society where individuals are their own bank and they inherently avoid censorship from any third parties such as governments seeking to seize control. Pretty awesome right? Why aren’t they used more often then?

 

THE REALITY

Usability

First, they are difficult to use for the consumer, with the high barriers to entry in the Blockchain space already, centralised companies like Coinbase have thrived from attracting new money through their simple user interfaces and user experiences. No need for understanding a public or private key, just connect your bank account and buy some crypto. Unfortunately, this approach is far more appealing, who wants to understand how the technology works as long as it functions? Early adopters perhaps, but not the majority. Here we are again at square one, with our funds in the control of a centralised authority.

 

Functionality

Second, decentralised exchanges offer limited functionality compared to their centralised competitors.  Unfortunately, entirely relying on distributed networks has not yet allowed exchanges to offer certain essential trading utilities such as stop losses and limit orders, two things the majority of traders simply cannot function without. Additionally, the number of different cryptocurrencies on offer are often largely limited to a select few as result of the point to follow.

 

Lack of Liquidity

The shortcomings of usability and functionality lead to decentralised exchanges not being able to encourage the trade volume necessary for an exchange to function as it should. There are often difficulties finding a counterparty to match one’s trade order, resulting in missed opportunities and aggravated traders. The less liquid the cryptocurrency in general, the less likely one will find a counterparty to complete their trade.

 

THE STATUS QUO

At first glance of the ideal, one might question why most exchanges who supposedly support a decentralised future are living in the centralised present.  But after thorough analysis, it is clear that Blockchain technology and its ecosystem simply isn’t ready to handle the complex functionality and underlying usability that traders desire. Maybe in years to come full decentralisation will be feasible, a world we should all strive to live in, but for now, it simply isn’t.

So, how can one be in control of their own funds whilst enjoying the complexities and subtleties of centralised trading? Enter the hybrid trading model.

 

Hybrid Trading

This model brings with it the best features of both the decentralised and centralised models. One can become their own bank and possess sole control of their funds whilst enjoying the functionality and usability of centralised platforms. No more exchange hacks, no authoritarian governments have the ability to seize funds or close accounts, complete financial freedom. Integrate such liberty with powerful means to profit from one of the biggest financial revolutions in human history and you are onto a winning combination. So how is this all possible?

 

Decentralised Custody

First one must understand the concept of decentralised custody. Utilising Blockchains that allow for the creation of smart contracts, Hybrid Trading Platforms, such as BBOD, merely settle profit and loss from a personal distributed wallet by employing the functionality of smart contracts. Here, one creates a set of defined rules which auto-complete when such rules are met. In this case, settle profit and loss every 24 hours between different counterparties.

Such personal wallets are inherently impenetrable as they are distributed over the entire chosen Blockchain ecosystem, BBOD utilises Ethereum’s. In order to hack one account, you would have to hack every account simultaneously, much like the Blockchain itself, an impossible feat when networks are distributed over millions of computers.

Thus, BBOD users become completely in control of their own funds in an incredibly secure decentralised manner and can choose to withdraw money from their personal wallet at any time.

 

Centralised Trading Engine

Second, one must understand the concept of a centralised trading engine. Here transactions are settled off-chain utilising the mechanism commonly used on centralised exchanges. For instance, BBOD utilises a custom trading engine built by well-respected GMEX, which can handle more than a million transactions per second with latency of less than 25 microseconds.

Essentially this ensures lightning fast transaction speeds between parties, avoiding the pitfall of the functionality of decentralised exchanges. Additionally, BBOD’s user-interface is extremely user-friendly allowing traders of all levels to utilise the platform.

 

CONCLUSION

This article has discussed the pitfalls of centralised exchanges, the pro and cons of fully decentralised exchanges and the overwhelming benefits of hybrid trading platforms, such as BBOD.

Now one must ask themselves how much trust they want to place in the hands of centralised exchanges. Do you want to be a victim of the next centralised hack? Blockchain technology has afforded us the ability to be in control of our own funds, so why not utilise this capability for the security and freedom that it allows.

BBOD offers users financial freedom and the opportunity to get involved in the ever-evolving cryptocurrency revolution. Be sure to make the most of being an early adopter.

 

 

Ethereum White Paper, Explained. Part 2

We are glad you made it to the second part of our dissection of the ethereum white paper. Read on to uncover the rest of the ethereum white paper document.

Ethereum White Paper Format.png

Ethereum was built around the central focus of creating a protocol for building a variety of decentralized applications with numerous use cases.

They provide a Turing complete programming language where development time, security and interaction between dapps (decentralized apps) are important. A Turing complete programmable blockchain allows a wide variety of smart contracts to be developed which are much more sophisticated than those offered by Bitcoin.

Ethereum Philosophy

Ethereum is designed on the following five principles.

Simplicity

Ethereum is built as a protocol that is simple and has a vision of being open to all, even at the

cost of data storage and time inefficiency. Any average programmer should be able to pick the

workflow and implement projects with ease.This helps in fully realizing the unprecedented

potential of Blockchain and Cryptocurrency.

Universality

The Turing completeness of Ethereum helps in creating any smart contract that can be

mathematically defined. Currency, financial derivatives or your very own Skynet, anything can be built. However if you do plan on building Skynet, you might need to have an array of many interlocking contracts and feed them with enough gas to keep the smart contract running.

Modularity

Ethereum is designed such that all parts of the protocol can be separated into individual units. Even if somebody makes a small protocol modification in one place, other parts of the application stack would be seemingly unaffected and continue to work without further modification.

Innovations like Ethash, modified Patricia trees and RLP (which will be discussed in future posts) are implemented as separate, feature complete libraries. Ethereum development is done so as to benefit the whole cryptocurrency system rather than just itself.

Agility

Constructs of the Ethereum protocol are not set in stone, although modifications to high-level constructs will only be done judiciously.

Non-discrimination and non-censorship

Being a true open for all protocol, any and all kinds of applications can be developed using Ethereum. The regulatory mechanisms used in Ethereum are used to restrict and minimize the harm to the ecosystem rather than restrict a specific category of applications.

For instance, you can run an infinite loop script as long as you pay necessary and relevant charges to the miners for running your code.

Ethereum Accounts

In Ethereum, the state is made up of objects called “accounts” where each account has a 20-byte public address. State transitions are transfers of value and information between two or more accounts. An Ethereum account contains the following four fields.

  • Nonce; this is a counter that ensures each transaction can only be processed once
  • The account’s current Ether balance
  • The account’s Contract code, (if present, applicable to smart contracts)
  • The account’s Storage (empty by default)

Ether is the main fuel used in Ethereum and is used for transaction fees also known as Gwei.

There are two types of accounts namely :

  1. Externally owned accounts; controlled by Private keys : Have no inherent code. Messages are sent by creating and signing a transaction.
  2. Contract accounts; controlled by Contract code : Code activates depending on the content of the received message and further process like reading & writing into internal storage, sending other messages or creating contracts can be activated.

The second type of account is used by a cryptocurrency exchage :Blockchain Board of Derivatives in its non-custodial smart contract wallet system.

Smart contracts are thus autonomous agents that live inside the Ethereum environment and execute code when conveyed by a transaction or a message. Such contracts have direct control over their ether balance and their own key store.

Transactions

Transaction in Ethereum is essentially a signed and encrypted data package that stores a message to be sent from an externally owned account.

Typical transactions contain the following:

  • The recipient of the message (Public Key of the recipient)
  • Signature identifying the sender (Private Key of the sender)
  • The amount of ether to transfer from the sender to the recipient
  • An optional data field
  • A STARTGAS value, representing the maximum number of computational steps the transaction execution is allowed to take
  • A GASPRICE value, representing the fee the sender pays per computational step

Let us break down these individual points. The first three are standard fields present in every cryptocurrency. The data field has no default function but can be used by a contract to access the data. For instance, if a contract is functioning as a domain registration service, then it may wish to interpret the data being passed to it as containing two “fields”, the first field being a domain to register and the second field being the IP address to register the domain to. The contract would read these values from the message data and appropriately place them in storage.

STARTGAS and GASPRICE fields are crucial for Ethereum’s anti-denial of service model. In order to prevent infinite loops or other computational wastage, each transaction is required to set a limit to the number of computational steps it can use. The fundamental unit of computation is “gas”. Usually, a computational step costs 1 gas, but some operations cost higher amounts of gas because they are more computationally expensive or increase the amount of data that must be stored as part of the state.

There is a fee of 5 gas for every byte in the transaction data. The fee system causes an attacker to pay proportionately for every resource that they consume, including computation, bandwidth and storage. Hence, any transaction that leads to high network consumption naturally leads to a higher gas fee.

In simple terms, gas paid is directly proportional to the number and complexity of computations done on the blockchain.

Messages

Contracts can send messages to other contracts.

Typical messages contain:

  • The sender of the message
  • The recipient of the message
  • The amount of ether to transfer with the message
  • An optional data field
  • A STARTGAS value

A message is similar to transaction except that messages are created by a contract and not an externally owned accounts. A message is produced when a contract executing code executes the CALL opcode, producing and executing a message.

The message is received by the recipient account which then runs its code. In this manner, contracts can enact in relationships with other contracts in a way similar to externally owned accounts.

The gas allocation assigned by a contract applies to both the gas consumed by transaction and all sub-executions.

Let us understand the same with an example.

@A is an externally owned account

@B is a contract

@A sends @B a transaction with 1000 gas.

@B consumes 600 gas and sends a message to @C.

The internal execution of @C consumes 300 gas.

1000-600-300=100

This implies that the contract @B can only spend another 100 gas on computation / message / transaction before running out of gas.

Ethereum State Transition Function

eth paper 2.2.PNG

As mentioned in part 1 of the series, you might recall the state transition function

APPLY(S,TX) -> S’

Further steps are taken from the white paper and are pretty much self-explanatory:

  1. The transaction must have the right number of values, the signature must be valid and the nonce should match the nonce in the sender’s account. If it does not comply, throw an error.
  2. The transaction fee is calculated as STARTGAS * GASPRICE, the sending address can be determined from the signature. Subtract the fee from the sender’s balance and increment the sender’s nonce. If there is not enough balance to spend, throw an error.
  3. Initialize GAS = STARTGAS, and a certain quantity of gas per byte is taken off to pay for the bytes in the transaction.
  4. Transfer the transaction value from the sender’s account to the receiving account. If the receiving account does not yet exist, create it. If the receiving account is a contract, run the contract’s code either to completion or until the execution runs out of gas.
  5. If the value transfer failed because the sender did not have enough money, or the code execution ran out of gas, revert all state changes except the payment of the fees, and add the fees to the miner’s account. The payment of fees cannot be reverted as miner expends energy to facilitate the transaction.
  6. Otherwise, refund the fees for all remaining gas to the sender, and send the fees paid for gas consumed to the miner.

Assume the contract code to be the following:

if !self.storage[calldataload(0)]:
self.storage[calldataload(0)] = calldataload(32)

The contract is actually written in low-level EVM code but the above example is written in Serpent.

Now let us consider an example:

The contract’s storage is initially empty and a transaction is sent with 10 ether value, 2000 gas, 0.001 ether gasprice, and 64 bytes of data, with bytes 0-31 representing the number 2 and bytes 32-63 carrying the string CHARLIE.

The state transition function process in this scenario is as follows. These steps are similar to the ones mentioned in the generic example above.

  1. Check that the transaction is valid and well-formed.
  2. Check that the transaction sender has at least 2000 * 0.001 = 2 ether. If it is, then subtract 2 ether from the sender’s account. (Since we have to use STARTGAS * GASPRICE as the formula)
  3. Initialize gas = 2000; assuming the transaction is 170 bytes long and the byte-fee is 5, subtract 850 (170*5) so that there is 1150 (2000-850) gas left.
  4. Subtract 10 more ether from the sender’s account, and add it to the contract’s account.
  5. Run the code. In this case, this is simple: it checks if the contract’s storage at index 2 is used, notices that it is not, and so it sets the storage at index 2 to the value CHARLIE. Suppose this takes 187 gas, so the remaining amount of gas is 1150 – 187 = 963
  6. Add 963 * 0.001 = 0.963 ether back to the sender’s account, and return the resulting state.

This concludes the steps that are undertaken in the whole process.

If there was no contract at the receiving end of the transaction, then the total transaction fee would simply be equal to the provided GASPRICE multiplied by the length of the transaction in bytes, and the data sent alongside the transaction would be irrelevant.

In this case, all gas would be utilized by a miner to provide no result as any contract does not exist.

Messages and transactions work on similar terms when it comes to reverts: if a message execution runs out of gas, then that message’s execution, and all other executions triggered by that execution, revert, but parent executions do not need to revert.

This implies that it is “safe” for a contract to call another contract as if A calls B with G gas then A’s execution is guaranteed to lose at most G gas. However, parent executions outside of contracts do not revert.

Also, there is an opcode, CREATE, that creates a contract. Its execution mechanics are generally similar to CALL, with the exception that the output of the execution determines the code of a newly created contract.

We will delve into opcode in further detail in our future in-depth technical blog posts.

Code Execution

The code in Ethereum contracts is written in a low-level, stack-based bytecode language, referred to as “Ethereum Virtual Machine code” or “EVM code”. EVM code is essentially a series of bytes and each byte is an operation.

“Code execution is an infinite loop that consists of repeatedly carrying out the operation at the current program counter (which begins at zero) and then incrementing the program counter by one, until the end of the code is reached or an error or STOP or RETURN instruction is detected.”

The operations have access to three types of space in which to store data:

  1. Stack, a last-in-first-out container to which values can be pushed and popped like a typical stack.
  2. Memory, an infinitely expandable byte array.
  3. Storage, a key/value store. Unlike stack and memory, which resets after computation ends, storage persists for the long term.

The code also has the ability to access the value, the sender, the data of the incoming message and the block header as well. The code can also return a byte array of data as output.

The execution model of EVM code is quite simple. We will further explore it in the below steps.

While the Ethereum virtual machine is running, its full computational state can be defined by the tuple. A tuple consists of block_state, transaction, message, code, memory, stack, pc and gas.

Here, block_state is the global state containing all accounts and includes balances and storage.

At the start of every round of execution, the current instruction is found by taking the pc-th byte of code (or 0 if pc >= len(code)) which means pc is considered to be zero when it is greater than or equal to the length of the code.

Each instruction has its own definition on how it would affect the tuple.

ADD pops two items off the stack, pushes their sum, reduces gas by 1 and increments pc by 1 (typical working of a stack)

SSTORE pops the top two items off the stack and inserts the second item into the contract’s storage at the index specified by the first item.

There are many ways to optimize EVM execution via just-in-time compilation, a basic implementation of Ethereum can be done in a few hundred lines of code.

Blockchain and Mining
eth paper2.3.PNG

Ethereum blockchain is more or less similar to the Bitcoin blockchain with a few subtle differences.

The main difference between Ethereum and Bitcoin with regard to the blockchain architecture is that, unlike Bitcoin (which only contains a copy of the transaction list), Ethereum blocks contain a copy of the transaction list, the most recent state, the block number and the difficulty.

The basic block validation algorithm in Ethereum can be explained in the following steps:

  1. Check if the previous block referenced exists and is valid.
  2. Check that the timestamp of the block is greater than that of the referenced previous block and less than 15 minutes into the future.
  3. Check that the block number, difficulty, transaction root, uncle root and gas limit (various low-level Ethereum-specific concepts which will be covered later) are valid.
  4. Check that the proof of work on the block is valid.
  5. Let S[0] be the state at the end of the previous block. (recall this being discussed and explained in the previous blog post)
  6. Let TX be the block’s transaction list, with n transactions. For all i in 0…n-1, set S[i+1] = APPLY(S[i],TX[i]). If any applications returns an error, or if the total gas consumed in the block up until this point exceeds the GASLIMIT, return an error.
  7. Let S_FINAL be S[n], but adding the block reward paid to the miner (S_FINAL =S[n]+Block reward). The reward is awarded once a miner completes mining a block successfully.
  8. Check if the Merkle tree root of the state S_FINAL is equal to the final state root provided in the block header. If it is, the block is valid; otherwise, it is not valid. (Merkle tree and validation with the block header is explained with relevant pictures in the previous blog post)

The approach of storing the entire state within each block might seem inefficient at first but is comparable to that of Bitcoin.

The state is stored in the tree structure and after every block, only a tiny part of the tree needs to be changed. This implies that between two adjacent blocks, the vast majority of the tree should be the same. The data can be stored once and referenced twice using pointers (hashes of subtrees).

A special kind of tree known as a “Patricia tree” is used to accomplish this, including a modification to the Merkle tree concept that allows for nodes to be inserted and deleted in an efficient manner.

Additionally, because all of the state information is part of the last block, there is no need to store the entire blockchain history.

A commonly asked question is “where” contract code is executed, in terms of physical hardware.

The process of executing contract code is defined in the state transition function itself, which is part of the block validation algorithm. If a transaction is added into block B the code execution spawned by that transaction will be executed by all nodes that download and validate block B, either now or in the future.

This marks the end of Part 2 of the Ethereum white paper. In the next part, we will discuss real-time applications of the Ethereum protocol and the ecosystem.

Part 3 available here.

Ethereum White Paper, Explained. Part 1

In the following blog posts, we will be dissecting the Ethereum white paper by describing it in layman terms. As the paper is too long to fit into one blog post, we will be dividing it into several sections. We will try to explain the niche details mentioned in the Ethereum white paper in the simplest terms possible.

Ethereum White Paper Format.png

 

Introduction and Existing concepts


We all know that Satoshi Nakamoto’s development of Bitcoin gave rise to the monumental technology known as – Blockchain. Hopefully, you already know what Blockchain technology is, thanks to our previous posts.

There are numerous other applications for Blockchain technology some of them include: coloured coins, smart property, namecoin, smart contracts or DAO (Decentralised Autonomous Organizations). These applications are complex to build on top of the Bitcoin blockchain. To address this issue, Ethereum proposes a Turing-complete programming language that can be used to create smart contracts or encode complicated functions. A Turing-complete language can essentially be used to simulate a Turing machine. A Turing machine is a model that can simulate any computer algorithm regardless of the complexity.

The Ethereum foundation proposes that all of the above can be achieved effortlessly in a few lines of code. We will validate this claim further in this blog and future posts.

 

History


Digital currencies as a concept have been prevalent for decades. In the 80s and 90s, a cryptography technique called Chaumian Blinding was used. However, they relied on a centralised intermediary which was a clear deal breaker. Then came B-money which proposed a decentralized consensus system but how that would be achieved was debatable. This was followed by Hal Finney proposing reusable proofs of work which when combined with the concept of B-money seemed promising at first but attempts to implicate such a solution were unsuccessful.

Satoshi Nakamoto collated all of these concepts along with other established primitive technologies for managing ownership through cryptography techniques. The consensus algorithm used by the Bitcoin Blockchain to keep track of the coins is called proof of work.

The proof of work consensus mechanism was a major breakthrough in this area as it solved two main problems.

  1. Nodes in the network could now easily agree on using the consensus algorithm to enter transactions in the distributed ledger.
  2. The problem of who gets to decide the entry into the distributed ledger was solved by using the computing power each node is willing to spend.

For miners, this essentially means – More computing power = More blocks mined = More crypto rewards.

Another concept called proof of stake calculates the weight of a node in the voting process based on the number of coins it holds and not just computational resources.

 

State transition systems


The ledger of any cryptocurrency is essentially a state transition system which at any given point in time holds information about how many coins are there in individual wallets and the transactions done by these wallets.

In the below diagram there are three main blocks to be considered

 

 Image Courtesy: https://github.com/ethereum/wiki/wiki/White-Paper

 

State – This consists of all ownership information contained in the ledger which is cryptographically encrypted.

Transaction – Transaction block defines the amount of the transfer that is initiated in the system. It also includes a signature which is defined by the sender.

State’ – This state consists of the final ownership information that is distributed across all nodes. This State’ will then act as State in the next transaction.

In a traditional fiat banking setting, the states are individual balance sheets and when money is sent from A to B, their individual records get updated.

Obviously, using traditional banks we cannot send more money than we have in our individual accounts, a similar logic has been applied here which is defined by the following function.

APPLY(S,TX) -> S’ or ERROR

To illustrate this in the context of the banking example, we can translate it into the following expression.

CRYPTO

APPLY(S,TX) -> S’

BANKS

APPLY({ Alice: $50, Bob: $50 },”send $20 from Alice to Bob”) = { Alice: $30, Bob: $70 }

Here S is the initial state where both Alice and Bob have $50 in their accounts.

TX is the transaction which defines “send $20 from Alice to Bob”

S’ is the final state which reflects the updated balances of Alice and Bob

Before moving to the next scenario, we must understand how the possession of coins in individual accounts is calculated.

A bitcoin “state” has the collection of all coins that exist along with the public key of their owner. The collection of these coins are determined by total UTXO associated with the address. UTXO is Unspent Transaction Outputs, which as the name suggests have not been spent by the owner. These outputs are measured by checking if the coins that came from the previous owner were also UTXO, to begin with. This is confirmed by checking the previous owner’s UTXO and pairing it with the cryptographic signature produced by the previous owner’s private key.

Now let us analyse what happens if you try selling coins that you don’t have?

CRYPTO

APPLY(S,TX) -> ERROR

BANKS

APPLY({ Alice: $50, Bob: $50 },”send $70 from Alice to Bob”) = ERROR

1. Check the value mentioned in TX ($70)

a.    If this value is not verified by UTXO of the owner, then it is not present in their account. Return an error.

b.    If the mentioned cryptographic signature does not match the signature of the owner, return an error.

2.     If the sum of all UTXO of the owner is less than the figure mentioned in TX, return an error.

3.    If the transaction is valid, transfer funds to the receiver. This transfer happens by removing the input UTXO from the sender and adding it under the receiver’s public key address.

Step 1a prevents the sender from sending coins that do not exist and step 1b prevents senders from sending other people’s coins.

Step 2 makes sure that there are enough coins with the sender before proceeding with the transaction.

Step 3 completes the process by subtracting values from the sender and adding it in the receiver’s wallet.

Now, these steps might look easy to visualize but behind the scenes, there is a lot going on.

The following example should help you better understand.

Suppose you go out to buy a bunch of Bananas. Now for some vague reason, 1 banana costs $75. In a traditional setup, to see if you can afford this precious overpriced banana, you will open your wallet and check the balance. You have two notes of $50 each totalling $100 (50+50=100, duh!). These two notes were given to you by your mom to buy Bananas.

To be able to afford this Banana you have to give away both your $50 notes to the Banana seller and he will return $25 using a combination of USD note denominations. You are now a proud owner of this super expensive Banana. The real problem that now lies ahead of you, is explaining to your mom the price of 1 Banana.

This is reasonably simple to understand, now let us see what happens in a typical cryptocurrency transaction.

Consider Alice wants to send 75 BTC (yes, Alice is filthy rich) to Bob. To proceed she will first check if she has 75 BTC in her wallet. To check this, she must sum up all of her UTXO (value inputs). Consider this UTXO as the two notes of $50 in the previous example. However, Alice has two UTXO values in her wallet of 50 BTC each. This implies that Alice has received two transactions into her wallet. Each UTXO is worth 50 BTC.

Now, we know that you cannot cut a $100 note into two parts to divide into two $50 notes, that would render the $100 note worthless. However, in cryptocurrency, you can do microtransactions by dividing 1 coin into ten 0.1 coins. This division is, however, not straightforward.

To transfer 75 BTC to Bob, Alice will create a transaction with the two 50 BTC inputs to give out two outputs. One output will be given to Bob, another balance will be transferred back into Alice’s wallet.

50BTC + 50BTC → 75BTC to Bob + 25BTC to Alice

In this scenario, Bob is not entrusted with returning the balance as compared to the previous example. Rather the transaction handles the return of the remaining balance output to Alice.

 

Mining


 Image Courtesy: https://github.com/ethereum/wiki/wiki/White-Paper

In an ideal society where we could trust a centralized system with all transactions, this step would be totally unnecessary. But we are trying to create a decentralized consensus system that has the potential to disrupt the monopoly that banks have over our economies. Mining is a method by which we can combine the state transition system with a consensus system such that all nodes in the network agree on the transactions. These transactions are combined and packaged into blocks as shown in the below figure.

The Bitcoin network produces 1 block every 10 minutes. Each block has a timestamp, a nonce (an arbitrary non-repeatable number), a reference to the previous block mentioned as Prevhash in the above diagram and the list of all transactions that have taken place after the previous block is mined. This never-ending chain of blocks always represents the latest state of the distributed ledger and thus acquires its name – the Blockchain.

The following steps check the validity of a block:

  1. Check if the previous block referenced by the block exists and is valid.
  2. Check that the timestamp of the block is greater than that of the previous block and less than 2 hours into the future.
  3. Check that the proof of work on the block is valid.
  4. Let S[0] be the state at the end of the previous block.
  5. Suppose TX is the block’s transaction list with n transactions. For all i in 0…n-1, set S[i+1] = APPLY(S[i],TX[i]) If any application returns an error, exit and return false.
  6. Return true, and register S[n] as the state at the end of this block.

Points 1 to are straightforward. However, the next 3 points might sound a bit confusing. Let us understand how that works.

As mentioned in point 4, let S[0] be the state at the end of Block 5624.

In point it is mentioned that for each n transaction, there is a particular state as follows:

So by the function →  S[i+1] = APPLY(S[i],TX[i])

We have the following:

S[1] = APPLY(S[0],TX[0]) ← First transaction

S[2] = APPLY(S[1],TX[1]) ← Second transaction

.

.

S[n] = APPLY(S[n-1],TX[n-1]) ← nth transaction

If you remember the function that we read about in the previous topic. We should be able to backtrack the value of S’ based on the Apply function.

APPLY(S,TX) -> S’

This is predominantly used to link various transactions and blocks. So each transaction in the block defines a valid state transition using the above functions from one transaction to another. The state, however, is not stored anywhere in the block and is calculated correctly only by starting from the genesis state of that particular block, for every transaction in that block. This finally gives an output of S[n] which will act as S[0] for the next block.

The order of the transactions is of prime importance because if B creates a transaction involving funds (UTXO) that have been sent (created) by A, then the transaction done by A must come before B for the block to be valid.

The condition of proof of work required is that the double-SHA256 hash of every block which is a 256-bit number must be less than a dynamically adjusted target. These dynamic targets vary from time to time so that the miners provide ample computational power to confirm their proof of work. Also, since the SHA256 function is completely pseudo random and unpredictable, the only way to crack it is by simple trial and error or brute force.

Suppose the dynamic target is set at ~2150 , then the network must achieve an average of 2(256-150) which equals 2106 tries before a valid block is found. This dynamic target is reset every 2016 blocks and calibrated to new target value. A new block on an average is produced every ten minutes on the Bitcoin network. For all the heavy lifting that miners do by facilitating our transactions and solving complex math problems, they are given Bitcoins as reward. The initial reward was 25 BTC per block mined. Currently, the reward is 12.5 BTC per mined block. This is how bitcoins come into circulation. The Bitcoins awarded to miners are new bitcoins that are being unlocked from the 21,000,000 Bitcoins which is the hard limit of Bitcoins that can ever be in circulation.

 

WHAT HAPPENS IN THE EVENT OF AN ATTACK?


Now let us analyse the benefits of mining and how it prevents attacks. The following lines have been picked from the Ethereum white paper as the text is pretty much self-explanatory.

“The attacker’s strategy is simple:

  1. Send 100 BTC to a merchant in exchange for some product (preferably a rapid-delivery digital good)
  2. Wait for the delivery of the product
  3. Produce another transaction sending the same 100 BTC to himself
  4. Try to convince the network that his transaction to himself was the one that came first. 

Once step (1) has taken place, after a few minutes some miner will include the transaction in a block, say block number 270. After about one hour, five more blocks will have been added to the chain after that block, with each of those blocks indirectly pointing to the transaction and thus “confirming” it. At this point, the merchant will accept the payment as finalized and deliver the product; since we are assuming this is a digital good, delivery is instant. Now, the attacker creates another transaction sending the 100 BTC to himself. If the attacker simply releases it into the wild, the transaction will not be processed; miners will attempt to run APPLY(S,TX) and notice that TX consumes a UTXO which is no longer in the state. So instead, the attacker creates a “fork” of the blockchain, starting by mining another version of block 270 pointing to the same block 269 as a parent but with the new transaction in place of the old one. Because the block data is different, this requires redoing the proof of work. Furthermore, the attacker’s new version of block 270 has a different hash, so the original blocks 271 to 275 do not “point” to it; thus, the original chain and the attacker’s new chain are completely separate. The rule is that in a fork the longest blockchain is taken to be the truth, and so legitimate miners will work on the 275 chain while the attacker alone is working on the 270 chain. In order for the attacker to make his blockchain the longest, he would need to have more computational power than the rest of the network combined in order to catch up (hence, “51% attack”).

The above text shows how to gain control over the blockchain, the attacker has to have more processing power than 51% of the total blockchain which is probabilistically impossible for top coins.

 

Merkle Trees


 Image Courtesy: https://github.com/ethereum/wiki/wiki/White-Paper

Merkle trees help maintain the uniqueness of a block. Merkle trees are a binary tree where each node has two children, and this goes all the way to the bottom to have individual leaf nodes which consists of transaction data. These leaf nodes build up to the top as shown in the below figure and end up in one ‘hash’. This hash of a block consists of a timestamp, nonce, previous block hash and the root hash of the Merkle tree as shown in the image on the left.

Now, the beauty of cryptographic functions is, even if one bit of input is changed, the whole encryption pattern changes and the intermediate hash value output is different. This changes the hash value output of the overall block and is rejected by the blockchain because it does not have a valid proof of work. The output of a Merkle tree is a single hash which is secure enough to act as an assurance to nodes.

These nodes compare this hash from one source with another small part of the Merkle tree from another source to ultimately validate the authenticity of the block. A similar scenario is shown in the right side of the above image when a node rejects a block because its hash does not match with the data in Merkle tree.

As the data stored in the blockchain of bitcoin is continuously increasing, there will be a point at which average desktop computers would not be able to store all the data. This is where a protocol known as “simplified payment verification” (SPV) comes into play. This protocol lets nodes verify the proof of work using the hash in individual blocks. Such nodes are also called as ‘light nodes’. These light nodes download the block headers, verify the proof of work on the block headers, and then download only the “branches” associated with transactions that are relevant to them. Light nodes thus assure that the transactions are legit despite downloading only a very small portion of the blockchain.

 

Alternative Blockchain Applications


  1. NameCoin
    NameCoin lets you register names on a decentralized database.
  2. Colored coins
    Colored coins serve as a protocol to allow people to create their own digital currencies on the Bitcoin Blockchain.
  3. Metacoins
    Metacoin protocol is stored on top of Bitcoin but uses a different state transition function from Bitcoin. They provide a mechanism to create an arbitrary cryptocurrency protocol.

There are two ways to build a blockchain system. The first is building an independent network and the second includes building a protocol on top of Bitcoin. The first approach is difficult to implement because of the costs involved. Also, the number of applications that would run on the Blockchain do not demand a full-fledged independent network. The requirements of these applications are relatively less computer intensive.

The Bitcoin-based approach has the flaw that it does not inherit the simplified payment verification features of Bitcoin. SPV works for Bitcoin because it can use blockchain depth as a proxy for validity; at some point, once the ancestors of a transaction go far enough back, it is safe to say that they were legitimately part of the state. A fully secure SPV meta-protocol implementation would need to backward scan all the way to the beginning of the Bitcoin Blockchain to determine whether or not certain transactions are valid.

 

Scripting


Bitcoin protocol does handle a primitive version of a concept known as ‘smart contracts’. UTXO in Bitcoin can be owned not just by a public key, but also by a complicated script expressed in a simple programming language. In this scenario, after a transaction, UTXO must provide data that satisfies the script. Afterall, even the basic public key ownership mechanism is implemented via a script which is verified using elliptic curve signatures. The script returns 1 if the verification is successful and returns 0 otherwise.

This can be further controlled to write a script that requires signatures from two out of a given three private keys to validate (“multisig”). This is a use case for large conglomerate corporate accounts, secure accounts and escrow situations. These smart contract scripts can be modified to do numerous actions depending on the use case.

However, there are several limitations in the Bitcoin scripting language:

  1. Lack of Turing Completeness – Loops are not available to prevent infinite loop situations but to write a smart contract in a language that is not Turing complete can be considerably daunting.
  2. Value Blindness – The UTXO script is not able to determine if the value of BTC has changed when compared to USD.
  3.  Lack of State – A UTXO can either be spent or unspent. To create complicated smart contracts that might include two stage cryptographic verification on the Bitcoin network is not possible.
  4. Blockchain Blindness – UTXO also does not have access to nonce, timestamp or previous block hash. This limits the application of Bitcoin in many fields.

“Ethereum proposes to build an alternative framework that provides even larger gains in ease of development as well as even stronger light client properties, while at the same time allowing applications to share an economic environment and blockchain security.” 

This concludes the interpretation of Part 1 of the Ethereum white paper. To summarise, this post gave us a general overview of how Bitcoin, the very first Cryptocurrency, functions. We will now move on to analyse how Ethereum is different from the Bitcoin protocol.

 

 

Blockchain – Value Proposition

architecture-bridge-city-1115737.jpg

Considering you now have a basic overview of how blockchain works from our previous blog post, let us dive into the possible use-cases of this beautiful technology. I am not over exaggerating when I call it beautiful, because once you understand the sophistication of this tech, you will go head over heels too.

To understand why blockchain is so important and why most people swear by its applications, let us understand the use case of blockchain in the transfer of value/cryptocurrency.

Exchange of value has been happening ever since human civilization began. Early humans used to barter goods to express value. Then came cowry shells and precious metals like gold, silver, etc. Value exchange is based on consensus and trust.

To understand this concept, let us consider the following example:

Suppose you have a handful of cowry shells, a couple silver coins, and some standard American dollars. You manage to build a time machine which takes you into the past and you go on a journey equipped with cowry shells, silver coins, and some USD.

Pre-Medieval Markets

In this pre-medieval market of the past, you approach a rice seller and offer him a couple USD. He looks at you strangely and throws away this bizarre-looking piece of rectangular paper. You hurriedly fetch the USD because you know it’s worth a lot more in modern markets than this rice seller considers it to be.

You then offer him some cowry shells. This is instantly recognized by the rice seller and he offers you a bag of rice in exchange.

Medieval Markets

You now travel to Medieval Europe again and offer the European rice seller a couple hundred USD sporting Benjamin Franklin. You are pretty certain that this rice seller could not possibly deny a couple hundred USD for a measly bag of rice!

This rice seller is also confused about your strange behaviour and tries to shoo you away. You then offer him a couple of silver coins and he parts with a bag of rice willingly.

Modern Markets

You come back to present day NYC and call your online grocer to ask if they accept cowry shells or silver coins instead of USD (because you have spent all the money you had in the medieval markets and in building a time machine). The grocer calls you several unpleasant things and hangs up.

Now on further inspection of these situations, you realize that markets at a particular time in history only accept a certain commodity as an exchange for value. If people do not know about different currencies as value stores, there is no consensus between buyers and sellers on the underlying value of a commodity. Because of a lack of trust, there is no transfer of value and an active trading market ceases to exist.

Cowry shells have value in pre-medieval markets because there is enough liquidity for them as both buyers and sellers trust in the prevalence of cowry shells.

People in medieval Europe believe in Silver because the sovereign issues silver coins and the general population trust in the sovereign to protect their assets and rights.

Similarly, people in current market places trust the USD because it is backed by the government of the United States and people trust the USA to uphold the value of their currency.

There is a grave problem emerging here. If you notice, as time progresses, centralised institutions like Sovereigns and Governments often tend to have higher control and monopoly over the transfer of value. This is beneficial for governments but is a huge red flag for the general public. The concentration of power in the hands of a few often leads to disastrous events, history is proof.

Future Markets

Blockchain disrupts the centralisation of trust by creating a distributed ledger that is not owned by a central authority. Instead, the decentralized trust mechanism is facilitated by millions of machines throughout the world by expending processing power using electricity. Like other markets, when we have buyers and sellers of a particular currency and they attain a consensus on how much a particular currency is worth, we have a post-modern cryptocurrency market.

Here the value of cryptocurrency is determined by the unique value it offers and how much the buyers and sellers think the system is worth. Such cryptocurrency marketplaces have the potential to obliviate several aristocratic legacy systems that only hinder progress. Blockchain Board of Derivatives is one such cryptocurrency marketplace.

The two biggest cryptocurrencies are currently Bitcoin and Ethereum.

Bitcoin’s value proposition is the pure exchange of value. It acts as a virtual currency specifically for value transfers.

Ethereum, on the other hand, can be used for the exchange of value along with a number of other promising use cases. One of them is smart contracts. Smart contracts enable you to program a set of predefined conditions in the blockchain to perform a certain task on the trigger of an activity.

Possession of property

agreement-business-businessman-872957.jpg

 

A simple example of this could be possession of a property. The smart contract acts as a facilitator between the buyer and seller. The buyer transfer funds into the smart contract and the seller transfers relevant titles of property. The smart contract holds information transferred by both parties in escrow, validates it on the decentralized network and facilitates the transaction only after sufficient confirmations

 

This is just one example of a use case developed on the Ethereum protocol. There are countless applications that can be developed using this powerful system. We will discuss the Ethereum White Paper in-depth in upcoming blog posts which will reveal how the Ethereum protocol works.

Apart from Bitcoin and Ethereum, there are numerous other cryptocurrencies and blockchain systems in the market and each has a unique use case that they propose. Blockchain has the potential to revolutionise almost all centralised trust based legacy systems.

Blockchain technology is truly the future and BBOD is committed to being at its helm.

Blockchain – Introduction

nasa-53884-unsplash.jpg

This article is a brief introduction to the world of Blockchain. You might have read Blockchain related articles or come across discussions on how Blockchain is going to change the world. Centralised institutions are either defensive or accepting of this disruption by defining their own terms.

 

So, what is all the fuss about? Let’s understand blockchain in its raw form.

Blockchain is a distributed database system. This means instead of storing files on a single computer, information is stored across millions of computers all over the globe.

FACEBOOK AS A CENTRALIZED ENTITY

When we log in to Facebook, all the content that we and our friends share on Facebook are stored in Facebook’s central server. Facebook technically owns all that data (even though they claim that they don’t own our data); they use that data to directly target ads towards us.

Blockchain technology disrupts this and gives users the power to control their personally identifiable information.

DECENTRALISED, DISTRIBUTED AND CENTRALISED SYSTEMS

The diagram shows three images sourced from Wikipedia.

 Source : Wikipedia

Source: Wikipedia


The first image depicts a centralised repository like Facebook, Google, Amazon, etc. where one central entity controls all information.

The second image is a decentralised system where a few nodes maintain the solidarity of the network through mutual consent yet allow free nodes to live by storing minimal data.

The third image is a distributed system where each node on the network will absolutely need to store all the information that is present in the network.


In the first image, if the central node is compromised, the whole system breaks down. But in decentralised and distributed systems, these kinds of attacks are impossible as at any given point in time, there are multiple copies of information throughout the network.

CONFUSED?

Well, the below example will clarify this concept.

Suppose Alice is transferring $100 to Bob via a traditional bank transfer. They both have an account in the same bank. When Alice initiates the transaction, the bank has a central database which deducts $100 from Alice’s account and adds $100 to Bob’s account. Now, this isn’t an ideal scenario because banks usually charge transaction fees

If something happens to the bank’s central database and that transaction is lost, neither Alice nor Bob get the $100. There are backups and safeguards in traditional banks to help prevent this, but this is still a very valid scenario. In case of a cyber-attack, all our funds in centralised servers are at tremendous risk. We as account holders, acknowledge and accept this risk because of the trust we have in these banking institutions.

Now, what if I told you, blockchain prevents all of this by creating a decentralised value exchange system with 100% uptime and a distributed trust system which is extremely difficult and highly improbable to crack.

In a distributed ledger system, once Alice initiates a transaction, all the nodes in the network confirm the transaction and the ledger is written in stone. It is immutable, and the transaction is secured. Even if an attacker tries to compromise one node, the transaction is still present in another node and to modify the transaction only in one node is still extremely difficult.

To change the details of one transaction, the attacker must modify all the following transactions in hopes of generating an alternate chain faster than the honest chain which is being processed by miners. Miners are facilitators of the transactions in the blockchain. They verify each transaction that comes across to their respective nodes by solving computationally difficult and processor intensive puzzles. The attackers’ transactions will not go through as honest nodes will reject transactions and blocks that are invalid. The attacker needs ample processing power to overcome the cumulative processing power of honest nodes which is highly improbable to achieve in well-established blockchain systems.

We will discuss more on Mining along with Public Keys and Private Keys (your crypto username and password) in future posts.

0_HHKyS6pSrWghQBnq.jpg

BLOCKCHAIN AS A CHAIN OF BLOCKS

Blockchain, as the name suggests, is a chain of blocks that are linked together one after the other. All nodes on the network have the full replication of all transactions that have taken place on the blockchain ever since the genesis block was mined. The ledger is open and the transaction between accounts will be displayed on the ledger for the whole world to see.

The transactions are cryptographically encrypted and the digital signature of one block is used to encrypt the next block. This is a perpetual system and to modify one transaction in the ledger is impossible. If an attack is tried, cryptographically encrypting all future blocks is computationally and economically a very expensive task.

We hope you now have a basic idea of what blockchain technology is all about. The implications of this technology are far and wide and will soon be at the helm of all trust-based systems.

BLOCKCHAIN – AS MANY HAVE PREVIOUSLY SAID, IS THE NEW INTERNET.