Friday, June 3, 2016

The Blockchain Revolution

Bitcoin may sound complicated at first, but when we sum it up, it is based on some very simple ideas:
  • digital signatures that facilitate identity
  • the distributed ledger (the blockchain) that is stored on every client’s device
  • the crowd collectively clearing each transaction
  • the need to make clearing transactions challenging to avoid a potential takeover of the blockchain
  • the need for an incentive (some equivalent of money, typically called the “coin” that is generated from within the system) to get the crowd interested in performing the challenging work that accompanies verifying transactions.
Now, if you think about it, peer-to-peer payment is actually a fairly simple commercial application. Once you establish identity, build a system to clear transactions, and convince people that they won’t lose their money, you’ve got enough trust to make things work. What’s being transferred is uniform (money). There’s no product variety to contend with. There are no physical assets involved. There’s no need to discover what’s available or compare prices.

Not surprisingly, therefore, much of the initial focus of blockchain marketplace development has been on creating new systems for trading assets that are non-physical: digital and financial assets.

The Blockchain


Blockchain can be considerred as a “new database technology, purpose-built for trading assets”. There is immense potential in new blockchain based marketplaces for loyalty points, mobile minutes, gift cards, and of course, a range of financial assets. Many current systems for trading such assets could benefit significantly from a new decentralized marketplace. It's not that there’s anything wrong with a centralized institution, but it increases costs, freezes innovation potential, and needs layers of reconciliation.

Let's take a look into those new inventions that based on the technology behind Bitcoin.


OpenBazaar and Contracts




The OpenBazaar platform takes a first step toward creating a decentralized peer-to-peer marketplace. If you have an item for sale, you list it on the OpenBazaar client (a program or app you download to your device), along with a product description, and a price (in bitcoin). Once you confirm listing the item, this listing is broadcast to all the other clients on OpenBazaar.

If you find a product that you like you can pay for it with bitcoin. Much like PayPal, which was a critical part of making eBay work early in the evolution of peer-to-peer markets, Bitcoin provides the necessary payment infrastructure for OpenBazaar. And analogous to eBay’s auction system, if the OpenBazaar price is too high for you, you can propose a new, lower price to the seller.

Once you (as the buyer) agree with the seller on a price, you arrive at another challenge. How do you ensure that you’ll actually get the product you bought? This is where a critical infrastructure element of distributed peer-to-peer markets comes in: contracts. On OpenBazaar, the contracts are relatively simple, using a notary as the trusted third party (can be another client). Once the contract is set up, you send your bitcoin payment, and these are held “in escrow.” You, as the buyer, notify the seller, saying, “I’ve sent the funds.” The seller then ships the product (and handles all the logistics). When the product arrives, you acknowledge receipt. The funds are then released to the seller. If there’s a dispute, the notary acts as the mediator.

A decision by any two of the three parties—buyer, seller, or notary—releases the funds. So, for example, the buyer and seller could resolve their dispute themselves. There’s a rating system to help choose sellers, buyers, and notaries. It’s a little different from what’s used in a centralized marketplace, and is not completely immune to manipulation (similar to Ebay).


Smart Contracts - new sophisticated class of contracts

While a traditional contract is an agreement between two or more parties to do something, in the case of a smart contract, the same terms exist, but with one exception—trust that comes from having a third-party is less important.

This is because the smart contract protocol can specify, as computer code, terms under which certain obligations are fulfilled (which is why people call it code is law), and can execute actions like sending a payment or deactivating a file once there is evidence of the contract’s terms being fulfilled.

By being autonomous, self-sufficient, and decentralized, smart contracts can decrease the risk associated with peer-to-peer contracting.


That's all for now, next time we will take a look at Ethereum, an alternative digital currency to Bitcoin and the Smart Contracts technology it is creating.

Wednesday, June 1, 2016

Introduction to Bitcoin

What is Bitcoin and how to get it?



In the simplest possible terms, Bitcoin is a digital currency.
You can acquire bitcoin by:
  • by exchanging it for your dollars, euros, or yen.
  • by providing someone with a product or service that they pay you in bitcoin.
  • by “mining” bitcoin (yes, it's similar to mining gold).
 To send someone bitcoin, you only need to know his bitcoin address.
Your acquisition and subsequent possession of this bitcoin exists as one or more entries in a public ledger (the blockchain) in which you are identified by a secure anonymized “key”. Each time you use your bitcoin, the new transaction is recorded as yet another entry in the ledger.





I thought it was a big scam?

 
A lot of the attention paid to Bitcoin has focused on its success in creating currency without a government backer, about how bitcoin value measured in traditional money fluctuates a lot over time (although its exchange rate has stabilized considerably in 2015), and perhaps also about the use of bitcoin for commerce that many governments consider illegal. Instead of rehashing those topics, I focus here on thinking about Bitcoin as one of many applications of a new set of enabling technologies: decentralized peer-to-peer marketplaces. See for yourself how it works for millions of people.


How does it work?


Let’s say that you want to send your friend Bob digital money. You would ideally say something like this: “I possess at least one currency unit from prior transaction Q, and I am giving Bob one unit.”

This establishes that you have the money, commits you to the transaction, and gives Bob access to the money. The physical-world equivalent would be if you were to give Bob a banknote.

Establishing a digital equivalent first requires the use of a “digital signature.” Let’s say that there are two unique numbers (called “keys,” analogous to what goes into a lock) associated with you. One of these is known only to you, or is stored on a device you own, and is called your private key. Another, available for anyone to look up, is called your public key. If someone “locks” a message (or encodes it using a cryptography algorithm) with your public key, this encrypted message can only be “unlocked” with your private key. And vice versa—if a message is encrypted with your private key, it can only be decrypted with your public key. This allows for a simple way to create a “signature”: since you are the only person who has your private key, then a message encrypted with it could only have come from you. And since your public key is public, anyone can verify that this is your signature.


Next there must be a way to prevent you from arbitrarily spending money you don’t have. In the physical world, this is accomplished by making bank notes hard to counterfeit. In a system like PayPal, on the other hand, a trusted third-party (i.e., a centralized entity, or PayPal itself)—keeps track of who has how much, and updates a private digital “ledger” of some sort every time someone sends money to someone else.


Bitcoin, in contrast, uses a public ledger, the blockchain. Every user of Bitcoin has a copy of this blockchain, and it contains every single bitcoin transaction since the currency was created. When you say, “I possess at least one currency unit from prior transaction Q, and I am giving Bob one unit,” Bob can verify that the message is from you by checking your signature, and he can then check his copy of the blockchain to be assured that you in fact have bitcoin to spend.


What if I simultanously send this coin to multiple people?


Now, let’s say you simultaneously send a signed message to both Bob and Alice giving them each one unit. If they both checked their current copy of the blockchain, they would find the prior transaction, it would seem like you have the money, and both of them would update their ledgers, leading to a problem down the line.

A possible solution might be to delegate maintaining the integrity of the ledger to the “crowd,” as I illustrate here with this simple scenario: After both Bob and Alice receive your message and check their copies of the blockchain to see if you have the money to spend, they then broadcast the transaction to the entire network of users. This transaction then joins a list of “pending transactions,” each of which will “clear” only when enough people on the network match the transaction against their copy of the blockchain and indicate that it is OK. During this waiting period it will likely be discovered that you have (perhaps mistakenly) tried to spend your unit twice.


But what’s to prevent you from creating millions of identities online and “taking over” the network by controlling a majority of the user accounts? If you managed to insert fake transactions suggesting you have money to spend into a majority of the copies of the blockchain, wouldn’t this allow you in effect to create “counterfeit” money?


Here come the Bitcoin Miners 


Bitcoin solves this problem in an ingenious way: continuing to rely on a crowd-based method of clearing transactions, but artificially adding complexity to the validation process. How is this accomplished, and why does it work? Well, when a user, let’s say Bob, checks the list of pending transactions and confirms their validity, Bob also has to solve an intensely challenging computational problem (the “challenge”). Solving a challenge is sort of like factorizing a big number—generating the two factors is difficult, but once you do that, verifying that their product yields the original number is easy. A Bitcoin challenge is significantly harder, but once solved, checking that the answer is correct is relatively simple.

Meanwhile, Alice and others might have also validated the list of pending bitcoin transactions and, in parallel with Bob, would be trying to solve the challenge as well. If Bob happens to win (solve the challenge first), others will verify that his answer is correct, then update their blockchains with his list of validated transactions. (It actually takes a little longer than that for a set of transactions to be accepted by the blockchain, but this is a detail that is less relevant to our discussion.)

As a consequence, Bob can’t simply or arbitrarily generate fake identities to take over the network and insert fake ledger entries. He’d need a large amount of computational power, and meanwhile, others are busy solving the same challenge to validate the transactions. And there’s enough randomness in the challenge so that the person with the most computational power doesn’t necessarily win (although having that power does have an advantage, on average.) So, while there is a risk that someone will invest way more than everyone else in computational power and start to take over the network, this is far more difficult and expensive than setting up millions of fake identities.




This leads to yet another problem, though. Computational power isn’t free. What incentive do Bob and Alice have to invest their resources into solving the challenge repeatedly? Well, the “winner” of the challenge gets issued new bitcoin! (As of 2016, this reward is 25 bitcoin, worth roughly 13k US dollars). This process of validating transactions, solving the challenge, and collecting the reward is referred to as “mining” new bitcoin. The reward is halved after every 4 years. Since there’s a new list of transactions (or “block”) to verify every 10 minutes or so, mining can translate into pretty good returns on one’s investment in computational power.

The next halving event is in July 2016. Read more about Bitcoin Mining here.

That's all for now. See you next time!