Exploring Alternative Coins - Learning Bitcoin (2015)

Learning Bitcoin (2015)

Chapter 8. Exploring Alternative Coins

"Cryptology represents the future of privacy [and] by implication [it] also represents the future of money, and the future of banking and finance."

--Orlin Grabbe, Economist, Prolific Writer

Bitcoin's success has led to the experimentation and adaptation of its underlying protocols and mechanisms. Since its release, there have been over five hundred alternative coins launched. Each coin assumes the liberty to borrow from and modify Bitcoin to implement its own variations on the original design.

In this chapter, we'll look at four innovative alternate coins (Litecoin, Namecoin, Peercoin, and Primecoin) to see how they have leveraged the blockchain technology to implement various concepts and systems in a decentralized way.

We'll see how the alternative coins can be used to store and validate arbitrary pieces of information such as domain names, public records, and digital assets. By simply changing the parameters of the blockchain, it can be used to arrange various bits of information in a way that is publicly transparent, easy to audit, and protected from manipulation. With these characteristics, developers have the tools necessary to create new and innovative systems.

In this chapter, we'll cover the following topics:

· The Introduction of Litecoin, Namecoin, Peercoin, and Primecoin

· Alternative consensus mechanisms and distribution schemes

· How to evaluate alternative coins

· Protocols built on the Bitcoin Blockchain

· Building a voting system with Counterparty

With so many alternative coins in existence today, how can one determine the legitimacy of a particular coin? How do we examine and compare the technical and economic merit of each coin? How do we leverage an alternative coin's unique implementation?

To answer these questions, let's start by exploring how so many coins came into existence, and more importantly, how we can discern which coins are worthy of interest.

Open source money

In the previous chapters, we have covered open source and have seen how the developers are able to quickly seed an idea and publish it, so that others can help contribute. The emergent effect is the rapid development of high-quality software. When developers from different backgrounds and perspectives are able to work together, difficult programming challenges are quickly resolved.

Bitcoin was launched as an open source project from the start. Early on, the developers were involved with the bug fixes and improvements. Satoshi Nakamoto was key in planting the seed for Bitcoin, but without a community of developers sharing and reviewing the code, the amount of trust earned by the system would have been limited. The open source approach inspires others to experiment.

Less than 2 years after Bitcoin's launch, the first alternative coin, an alternative test blockchain, appeared. It was called the Bitcoin Testnet. Launched in October of 2010, its purpose was to create an independent network and blockchain for testing purposes. The developers could easily obtain the Testnet coins, which were not intended to be worth anything, for the purpose of testing apps.

Yet, shortly after its launch, people were using the Testnet coins as real money. Thus, Testnet2 was launched by generating a new genesis block. Shortly after, Testnet3 was launched with some improvements and enhancements for testing.

With the ability to fork Bitcoin's original source code, the developers could quickly and easily start their own alternative coins, or alt-coins.

The rise of the alt-coin

As the interest in Bitcoin increased, the developers started proposing alternative uses for the blockchain technology. Early in 2011, several new alt-coins were launched to demonstrate this potential.

With each alt-coin, the developers imagined alternatives to the underlying mechanisms that make Bitcoin work. Primarily, the alt-coin developers searched for ways to improve the "proof-of-work" consensus system, on which the mining protocols were based, and ways to improve the distribution of coins.

The other alt-coins experimented with the possibilities of using the blockchain technology to build decentralized applications. The applications included decentralized storage, code execution, and identification.

For our examination of alt-coins, we will introduce several long running alt-coins: Namecoin, Litecoin, Peercoin, and Primecoin.

Namecoin

Recognized as the first true alt-coin based on a fork of the Bitcoin source code, Namecoin is an alt-coin that implements extensions in its blockchain to allow the recording of public name information for various applications. The first of these applications was a substitute for the Internet's domain name system (DNS).

Decentralized domain name service

The DNS is similar to a large phone book. When you type google.com into your Web browser, a request is made to the DNS servers asking to resolve the name to an IP address. The IP addresses are used to route information between two computers on the Internet, similar to the way the telephone system connects two phone numbers together.

With the original DNS system, the centralized authorities had established issue names, such as google.com or wikipedia.org, to organizations. Once purchased, the organization could modify the list of servers that their domain names resolved to.

There are some controversial issues with relying on central authorities for DNS. In some cases, governments or large corporations can use their power to take over the DNS system. Using their power, they can block, censor, spy, or take over the DNS entries. Free speech advocates claim this abuse of power is unethical, and against the Internet user's right to privacy and the right to access free information.

Namecoin offers a decentralized solution to this problem using blockchain technology. By purchasing namecoins, the users can purchase a .bit domain name by going through a centralized service. With control of their domain name through their private keys, the user can modify or sell the rights to the domain name without intervention.

Because the Namecoin blockchain is decentralized, no entity can compromise the system or block the access. Thousands of nodes, each containing a copy of the Namecoin blockchain, exist to serve and respond to the DNS requests. Without a centralized service to compromise, it becomes very difficult to control and manipulate DNS.

As a real-world example, Namecoins have proven how a decentralized system can replace the centralized organizations on the Internet. In a time of much institutional disruptions, decentralized applications and services may serve as a viable replacement to help preserve the rights of Internet users around the world.

Merged mining

Namecoin is also recognized as being the first alt-coin to introduce merged mining. To explain merged mining, one can recall a computer mining for bitcoins. A new block of transactions is assembled and a cryptographic function is applied to it until a solution to a difficult challenge is found. Once found, the solution is offered to the network as proof-of-work. The miners who are the first to submit proof-of-work are aware about new coins.

In most cases, a dedicated miner can only mine one blockchain at a time. However, with the rise of alt-coins, we can have many alternative blockchains competing for this available mining power.

A scenario based on dedicated miners has several effects. First, it creates competition for the miners between blockchains. Furthermore, when trying to launch a new blockchain, such as Namecoin, it could prove difficult to attract a viable number of miners to bootstrap the system. The primary reason being that people don't have an incentive to mine something that is not valuable.

Merged mining allows the proof-of-work from one blockchain to serve as proof-of-work for another as well. In an example between Bitcoin and Namecoin, a miner searching for namecoins can assemble a new block of namecoin transactions and embed a digest of the block into a new block of Bitcoin transactions.

The miner then continues computing the cryptographic function for the Bitcoin block until a valid hash is found for either the Bitcoin difficulty or the Namecoin difficulty.

If the proof-of-work hash is found for the Namecoin blockchain, the Namecoin block and the Bitcoin block are submitted as proof-of-work. The miner is then awarded new namecoins.

Merged mining

Figure 8.1 - Namecoin's merged mining feature accepts both a Namecoin and Bitcoin block as proof-of-work.

If the valid hash is for the Bitcoin difficulty, the Bitcoin block is submitted as proof-of-work, as normal. Only the hash from the Namecoin block is kept in the Bitcoin block. The miner is then awarded new bitcoins. Ultimately, the mining process remains the same with no changes needed to the protocol to support merged mining.

Merged mining

Figure 8.2 - If a valid hash is found for the Bitcoin difficulty, only the hash linked to the Namecoin block is kept.

Lastly, if both are found, then the miner is awarded both bitcoins and namecoins.

Merged mining leverages the same computing power to secure both the blockchains. In our preceding example, Namecoin must be programmed to accept the Bitcoin block as proof-of-work. However, the Bitcoin protocols do not require any changes.

The result is two independent blockchains secured by the same computing power.

Note

Additional information about the details involved with merged mining is available on the Bitcoin Wiki, at: https://en.bitcoin.it/wiki/Merged_mining_specification.

Litecoin

As the second largest cryptocurrency to date, in terms of market capitalization, Litecoin was built as a clone of the original Bitcoin software. Charlie Lee, an ex-Google employee who is now director of engineering at Coinbase, forked the original Bitcoin-QT code and released it as Litecoin in October of 2011 with some additional changes.

Block rate

Bitcoin is designed to deliver a new block approximately every 10 minutes. Some had raised the issue that the confirmation time was too long. Thus, Litecoin was launched with an increased block rate approximately every 2 minutes. This gives Litecoin the slight advantage of reducing the confirmation time, which improves the user's experience.

Litecoin can support higher transaction volumes due to the increased number of blocks. A faster block rate also implies that it's harder to double-spend litecoins. As 5 times more Litecoin blocks are produced for every Bitcoin block, the additional confirmations decrease the chances of double-spend.

However, Bitcoin's mining network is much larger and offsets Litecoin's advantage of having a higher block rate. As a disadvantage, the Litecoin network produces a larger blockchain with more orphaned blocks than the Bitcoin network.

The total number of litecoins is fixed at 84 million, 4 times the number of bitcoins. Yet, similar to Bitcoin, the number of litecoins issued through mining rewards halves every four years.

Scrypt mining

Litecoin's hashing algorithm is based on a different process than Bitcoin's mining algorithm. New blocks in Bitcoin are produced when a miner finds a block with a SHA256 hash that's less than the difficulty hash. On the basis of the varying difficulty level, a miner may need to repeat the hashing function billions of times to find a solution. Thus, the faster a miner can compute hashes, the more chances there are of finding a solution.

Specialized mining equipment, called Application Specific Integrated Circuits (ASICs), have allowed the miners to build high-speed mining rigs, which are able to compute trillions of hashes a second. This has led to a consolidation of the miners, with the side-effect of making the entry into mining impossible for the individual miners.

Litecoin mining is based on a cryptographic function called scrypt. Proposed as an alternative to hash mining, it helps to level the playing field for the smaller miners.

Scrypt was designed to make brute force attacks on passwords more difficult. For example, when a user types in a password, a scrypt function is executed to validate the password. This function is designed to use a combination of memory and processing power, which can take several hundred milliseconds to execute. For the user, this happens once each time a password is entered and is negligible.

If an attacker tries to crack the password, he should expect to execute the scrypt function several billions of times to find a solution through brute force. The few hundred milliseconds required for each pass will quickly add up during a brute force attack, making it very difficult to find a solution in any reasonable amount of time.

With Litecoin mining, a scrypt function is used to produce the proof-of-work required to claim a new block and its mining rewards. Because the scrypt function uses a combination of memory and processing power, individual computers are needed. The specialized ASIC mining equipment cannot be generally used to compute the scrypt algorithm.

This approach facilitates the joining of the smaller miners working with individual computers rather than large pools running high performance ASIC chips. This results in a more decentralized mining network.

Peercoin

Introduced in August 2012, Peercoin is an alt-coin that's mostly based on the original Bitcoin software. Prior to its release, a public announcement was made so that everyone had a fair notice to participate in its public offering. Peercoin's innovative ideas helped increase the energy efficiency of protecting the network with the aim of allowing for greater long-term scalability.

During its launch, new peercoins were issued through a proof-of-work mining process, similar to bitcoins. While the distribution of peercoins is supported through proof-of-work mining, the coins can also be issued through a "minting" process based on an alternative distribution method called proof-of-stake.

Proof-of-stake

Bitcoin's mining process requires a large amount of computing power to generate the proof-of-work needed to create a valid block of confirmed transactions. Designed as an alternative to proof-of-work, the proof-of-stake minting process issues new coins on the basis of the minter's ownership of the existing coins.

In the Peercoin protocol, the ownership of coins is measured by a "coin age". The coin age is calculated by multiplying the owned number of coins with the number of days the coins have been held. To begin competing for a block, a minter must have owned the coins for at least 30 days. Thus, larger and older sets of coins have a greater potential to earn. To offset this, once a set of coins have been used to earn a block, they are reset and 30 days must pass before they are eligible for minting.

Then, the minting process rewards the minters proportionally to the number of coins they own, with a target of 1 percent a year. Unlike Bitcoin's fixed number of coins, peercoins have an annual inflation rate of 1 percent a year.

Compared to Bitcoin's longest running blockchain, the official chain in Peercoin is based on the chain with the highest total consumed coin age.

The end result is a mining system that requires far less computing power than proof-of-work mining. The mining process is also distributed to those who hold the coins rather than to those who own high-performance mining equipment. This further levels the opportunity for entry.

Proof-of-stake is also claimed to be resistant to 51 percent of attacks. As ownership of coins is required for the attack, the cost exponentially increases. Compared with proof-of-work mining, large pools of miners can consolidate to overtake the network.

While the Peercoin network has a technical limit of 2 billion coins, it is only necessary for internal consistency. It is unlikely that the limit will be reached. Additionally, the proof-of-stake inflation rate will continue to produce new coins in the future.

Primecoin

Introduced in July 2013, Primecoin uses an entirely different method for mining coins. Proof-of-work is presented to the network in the form of prime numbers. Claiming to be the first cryptocurrency designed with scientific computing as its work, the miners compete for primecoins by searching for very large prime numbers.

There is no predefined limit to the number of primecoins, just the natural distribution based on the set of prime numbers. The scarcity of primecoins is set by the distribution of prime numbers within a given set. While each confirmed Bitcoin block contains a nonce and hash solution, each Primecoin block contains a prime number set as the proof-of-work.

Another significant difference between Primecoin and Bitcoin is the mechanism that governs the difficulty level. Rather than using an average block rate calculated after every 2,016 blocks, Primecoin adjusts the difficulty to search for prime number sets after each block with a target rate of one block a minute. Primecoin's quick adjustment interval allows faster confirmation times, approximately 8–10 times faster than Bitcoin.

Prime numbers

The primary advantage of Primecoin is the usefulness of its proof-of-work to the scientific community. Prime numbers, as most know, are numbers divisible by 1 and itself. Prime numbers have useful applications in the modern-day world, including cryptography. For example, RSA encryption uses large prime numbers to allow two parties to exchange secret messages using two keys, a form of public/private key encryption.

As a general overview, a public key is derived by multiplying two large prime numbers. The private key, which is held secret, is generated from the original two prime numbers. The public key can then be shared to encrypt message that can only be decrypted by the private key.

Alternatively, prime numbers help mathematicians study the distribution of prime number sets. They help answer questions such as "What is the largest gap between two prime numbers?"

Mining prime numbers

The primecoin network uses three methods to search for prime numbers: Cunningham Chain of the first kind, Cunningham Chain of the second kind, and Bi Twin Chains. Prime number chains are sets of prime numbers with certain mathematical characteristics.

Primecoin mining involves searching for valid sets of a target length. Searching for prime number chains becomes exponentially difficult as the chain's length increases.

Submitted as proof-of-work, it is easy to verify the set using the miners on the network. Because extremely large prime numbers can be hard to verify, there is a maximum size protocol to ensure efficient verification of the sets.

Primecoin miners still create a block of valid transactions to be hashed by SHA256 and include a nonce. This produces a proof-of-work hash similar to Bitcoin. With the hash value, the goal is then to find a valid set of prime numbers. The requirement for the set is that the origin of the chain is a multiple of the proof-of-work certificate.

The difficulty for mining, which is adjusted every block, is based on the length of the chain. Primecoin launched with an initial difficulty level of 7. This means that a chain with 7 primes must be found. Because the difference between a set with 7 and 8 primes can be many times more difficult, a fractional difficulty level is introduced on the basis of a remainder value.

The fractional difficulty level is based on the Fermat remainder of the prime number set. For example, with a difficulty of 7.5, approximately half of the chain of length 7 will be valid while the other half will not be.

Note

While Primecoin is mostly a copy of the Bitcoin software, the mining aspects involve complex mathematical algorithms. If you would like to learn more, download the Primecoin whitepaper from http://primecoin.io/bin/primecoin-paper.pdf.

Evaluating an alt-coin

With over 500 alt-coins in existence, it's important to be able to discern which are valid and which are scams. Let's look at a few important aspects to consider before buying into an alt-coin.

Developer activity

As an easy gauge to start with, the developer's activity is helpful when evaluating the legitimacy of a coin. By checking the public repositories of the source code, such as GitHub, one can see when the coin was made public, the contributions made to the code, and the activity level of the community.

As a reference, the GitHub repositories for the alt-coins discussed in this chapter are listed next:

· Litecoin: https://github.com/litecoin-project

· Namecoin: https://github.com/namecoin

· Peercoin: https://github.com/ppcoin

· Primecoin: https://github.com/primecoin

Looking through the commits, the developers involved, and the activity over time, one can assess the merits of an alt-coin.

If the source code is not publicly released, it could be a sign of a scam. All legit alt-coins are released as open source. If the developer didn't release the source to the public, it should be seen as a red-flag.

The developer of the coin should also be active on the forums and responsive to questions and comments regarding the coin. If there is no visibility or integration with the public, a red flag should be raised.

Ensure you perform some background checks on the history of the developers and their reputation within the online community.

Launching of the alt-coin

The method of launching an alt-coin is very important in terms of legitimacy. There should be a prior announcement to the public on forums or in the alt-coin community to give a fair notice to the miners and the users.

There is an instant red-flag if the developer launched the coin after mining the first coins in secret.

Because proof-of-stake requires the holdings of existing coins for minting new coins, a pre-mine action could be taken. This should be openly made public with good reasoning. If there is any inconsistency or shady activity, one should immediately raise a red-flag.

The legitimate feature set

Without any significant new features or improvements made, an alt-coin could be considered a "copy-cat" scam. Many coins have been introduced just to copy an existing coin with a view to profit. It is advised to avoid these coins.

Additionally, some coins may infringe on the copyrights or trademarks to create hype. Some coins may be named after celebrities and name brands, just to profit from the name. These coins should be avoided as well.

Tip

Exercise caution when getting involved with an alt-coin. Fraudulent IPO, pump-and-dump schemes, and other types of malicious intent are rampant in the alt-coin world. Never send your money to an untrusted exchange or website.

Protocols built on the Bitcoin Blockchain

Bitcoin's design allows developers to encode small pieces of information into each transaction. Using a predefined protocol, developers are able to build an entirely new alt-coin on top of the existing Bitcoin blockchain.

Several examples of blockchain protocols exist, each with different characteristics. Using these protocols, the developers can define various types of units of accounts, create assets and tokens, and transfer them using standard Bitcoin addresses.

This opens up the blockchain to many useful applications within the business world. As a real world example, the NASDAQ was the first public company to issue private equity using the Colored Coins protocol. With a high level of transparency, the ability to easily audit and resist corruption and manipulation and easily exchange assets using blockchain technology may bring immense value and creditability to the financial world.

Digital assets

With the ability to issue a unique identifier to the asset, we can issue and track the ownership of any real world property as a digital asset. Using public or open sourced protocols, we can easily record the ownership of a digital asset, with its history, on the blockchain.

As an example, the Colored Coins protocol allows the "tagging" of a Bitcoin transaction's output as an issuance of an arbitrary unit. Any subsequent transaction referencing the issuance transaction can then be colored as the unit issued.

Digital assets have many useful cases in the real world. Ownership of physical items, company stocks, or tokens used for voting can be issued, transferred, and audited.

In the next section, we'll explore a protocol called Counterparty that will allow us to issue tokens to create a voting system on top of the Bitcoin network.

Building a voting system with Counterparty

Counterparty is a protocol built on the Bitcoin blockchain that offers some unique features. With the protocol, the developers can create digital assets, transfer the assets, pay distributions, and execute various smart contracts.

Various use cases for these features include:

· Buying and selling tickets and coupons

· Secured access control

· Betting and gaming

· Proof of publication

· Crowdfunding

· Derivatives

· In-game currencies

· Voting tokens and auditing

· Programmable contracts

Counterparty provides easy to use tools for both developers and non-developers to implement these use cases. In our example, we're going to use Counterparty to create a voting system.

The XCP alt-coin

Counterparty is powered by its own native currency called XCP. Using XCPs, you can pay for the issuance of custom digital assets. One can easily purchase or sell XCPs on public markets. XCPs exchanged on the market carry their own exchange rate. At the time of writing, one bitcoin is worth approximately 250 XCPs.

Note

ShapeShift is a quick and easy way to "convert" one cryptocurrency it to another. Most of the alt-coins covered in this chapter, including XCPs, are available for instant conversion. The service is available at http://shapeshift.io.

XCPs were issued, one time, by "burning" bitcoins. Burning bitcoins is the process of sending bitcoins to an address that can never be used again. Essentially, each bitcoin is sent to an address that was created without a private key. The address can only receive coins; without the private key, the coins can never be sent.

By burning bitcoins in exchange for XCPs, the public can be assured that no one received any privilege or advantage over anyone else. Counterparty termed this process "proof-of-burn". Proof-of-burn helped to establish Counterparty as a legitimate protocol and currency.

Note

For your reference, the Counterparty proof-of-burn address is 1CounterpartyXXXXXXXXXXXXXXXUWLpVr.

The proof-of-burn process was opened to the public in January 2014. In exchange for depositing bitcoins, the senders received a fixed amount of XCP. During the process, a total of 2,648,755 XCPs were created. This amount is fixed and no more new XCPs will be created.

XCPs are used in Counterparty to issue new digital assets with a custom name, or to execute programmable contracts. However, in our voting system, we will use a pre-assigned name for our asset to save the fee.

Creating a voting system

Digital tokens issued through Counterparty can be used to represent votes cast by a panel of judges. In our example, we will set up a scenario of two teams, the Blue Team and the Red Team.

To keep our example simple, we will assume a panel of 3 judges and one administrator. The administrator will be responsible for issuing 3 digital tokens. The administrator will then send one token to each judge. To receive the token, each judge will need to create a wallet and provide the administrator with its address.

The administrator will then create an address for each team. The address will be used to receive tokens from the judges. The administrator will then publish the address to the panel of judges.

Once the "hypothetical performance" has been delivered, the judges will have the opportunity to vote for either team by sending their token.

Creating a voting system

Figure 8.3 - In our voting system, each judge will be given one token. The judges will then use the token to vote for the team of their choice.

To be able to send the tokens, a small bitcoin fee needs to be paid to the network. The miners will collect this fee to confirm the transaction on the Bitcoin network. Once confirmed, the results of the voting system will be final.

Each Counterparty operation will require approximately 0.0005 BTC. In our example, we will need one operation to create the tokens, three operations to issue the tokens to the judges, and three operations for each judge to vote.

With a total of 7 operations, 0.0035 BTC will be needed to fully execute our voting system.

Creating a wallet

To begin, we'll first need to create a wallet with, in our case, an online service. To simplify our example, we'll use one wallet to hold all the addresses for the administrator, judges, and teams. However, in a real world use case, each participant will be required to create a wallet secured by his own passphrase.

Start by opening the website http://counterwallet.io and click on Create wallet. The site will generate a 12-word passphrase for you. This passphrase will be used to open and protect your wallet.

Ensure you store this passphrase offline and secure it. If you lose the passphrase, you will not be able to recover it.

Creating a wallet

Figure 8.4 - Setting up a new wallet for XCPs using a 12 word passphrase

Once created, your Counterparty wallet will include a new address that you can either use to receive BTC and XCP, or to issue digital assets.

Using the Counterparty protocol, the transfers of digital assets are sent and encoded within the Bitcoin transactions. Thus, the same miners on the Bitcoin network will be confirming your transactions as with normal Bitcoin transactions.

Note

When issuing, transferring, or sending digital assets, note that the confirmation time, on an average, could take 10 minutes. However, in reality, the actual time needed for a miner to confirm a transaction could vary.

The following screenshot shows a new Counterparty wallet. Your address is displayed with a customizable label. Next to the address, a zero balance is displayed for both BTC and XCP.

Creating a wallet

Figure 8.5 - A Counterparty wallet showing a single address and the balance in BTC and XCP.

We'll use the first address for the administrator. Rename the label My Address #1 to Administrator by clicking on the address and entering the name.

Next, we will need to create an address for each judge and team. Simply click on the Create New Address button and select Create Regular Address. You will be prompted to enter a label.

Proceed by creating a new address for each of the following labels:

· Judge 1

· Judge 2

· Judge 3

· Red Team

· Blue Team

When finished, your wallet should have a total of 6 addresses, each with a zero balance.

Funding the wallet

Next, we need to fund the administrator with enough BTC to execute four operations. We'll estimate the cost at 0.0005 BTC per operation. The actual amount will likely be less, but having a little extra will give us some wiggle room. At any time of the exercise, you can withdraw the balance, minus any fees paid to the network.

Assuming you have a wallet setup with BTC from earlier in the book, send exactly 0.0020 BTC (0.0005 BTC times 4) to the administrator's address. You can display the QR code or copy the address by clicking on the Address Actions button from the panel and selecting Show QR Code.

We will need to repeat the funding process for each judge. One operation will be required from each judge to cast their vote. Similar to the case with the administrator, use your bitcoin wallet to send 0.0005 BTC to the address listed for each judge.

Now we will give the network some time to confirm the transactions. After a while the balances of each address will be updated to reflect the deposit. The reflected bitcoin balances should be as follows:

· Administrator: 0.0020 BTC

· Judge 1: 0.0005 BTC

· Judge 2: 0.0005 BTC

· Judge 3: 0.0005 BTC

The following screenshot shows the wallet funded and ready. To improve the readability of the wallet, you can choose to collapse each panel by clicking the "-" button on the right side.

Note that, if you would like to withdraw your deposit, click on the down arrow on the BTC balance and select Send. You will be prompted to enter a Bitcoin address and amount.

When the balances are available, we'll be ready to move on to the next step.

Funding the wallet

Figure 8.6 - The wallet with the administrator and each judge funded.

Creating the tokens

The next step will be for the administrator to create a digital asset to represent the three tokens. Once created, we will send one token to each of the judges.

To start, click on Address Actions and select Create (issue) a Token. The dialog box shown in the following screenshot will be displayed.

Ensure Free numeric name is chosen for our example. If the address contains an XCP balance, you will have the option of choosing an alpha-numeric name for the asset.

With the Free numeric name option selected, Counterparty will generate a random token name for you.

For the description, you can provide any name you want; this is optional.

For the quantity, select exactly 3, one for each of the judges.

Finally, ensure Make divisible? is unchecked. Since a vote cannot be divided, we will disable fractions when transferring the units.

Creating the tokens

Figure 8.7 - A dialog showing the parameters for our digital asset.

When finished, click Create Token. A new transaction, containing information about our digital asset, will be sent to the network for confirmation.

Allow a few minutes for the network to confirm the transaction. Once confirmed, a panel will appear, displaying the identifier and the quantity of tokens available in your digital asset.

Creating the tokens

Figure 8.8 - The administrator's address listing the issuance of 3 tokens

Sending tokens

Now that our tokens have been issued, we'll send one to each judge. By sending a token, a transaction will be created on the Bitcoin blockchain containing the details of the transfer.

First, select the address from Judge 1 by clicking on Address Actions next to its address and select Show QR code. Copy the address to the clipboard.

Next, click the down arrow in the asset panel, listed in the Administrator address, and select Send. You will be prompted with a dialog box as shown in the following screenshot:

Sending tokens

Figure 8.9 - Send Tokens dialog box

Simply paste the address in the Send To field, specify the amount as 1, and click on Send.

A transaction with the transfer details will be posted to the network, and within a few minutes, the balance will appear under the address for Judge 1.

Finish the process by sending exactly one token each to the remaining two judges. At the end of the process, the administrator's balance should be zero and each judge should have exactly one token.

Sending tokens

Figure 8.10 - Judge 1 has received the transfer of one token

Casting votes

Now the stage is set for the final vote! Each judge has been issued with one token representing one vote, and our teams, the Red Team and the Blue Team, are ready to deliver their performance.

Tip

To add a little randomness to the exercise, we can flip a penny for each judge's vote: Heads for the Red Team and tails for the Blue Team.

Each judge will now cast his vote by sending his token to one of the two teams. In our example, our two teams have the following addresses:

· Red Team: 1CH9ox9VgZf5DjRzvzL1nbJCZjsAuGoLvX

· Blue Team: 1HzVAjrUGMfH9QyT6nFYvkMJ5UnshkB9f7

In the same manner that we issued tokens to each judge, simply have each judge send his token to the address corresponding to the team of his choice.

After each judge sends his token, the public will have cryptographic proof of each vote and a public audit trail for verifying the results. In a real world example, we can maintain a database of the transaction IDs posted to the Bitcoin network, or rely on another service to query the results.

Verifying the results

We can use a third-party tool called Blockscan to verify the results. Blockscan is a service that maintains a searchable index of all the Counterparty assets and transactions. The site "crawls" the Bitcoin blockchain, in real time, and publishes the Counterparty data in an easy to use website.

With a quick search, we can locate our asset and publish a list of the holders of our digital asset.

Open the website http://blockscan.com and enter the asset's ID in the search box displayed on the top right. From the results listed, select the asset and click on the AssetHolders tab.

The final results are displayed as shown in the following screenshot:

Verifying the results

Figure 8.11 - Using Blockscan to display the results of our voting system

In addition to the asset holders, Blockscan provides reports of issuance, transaction history, and, if provided, title information about the assets.

Finishing up

If we choose, we can continue the voting process as described earlier for additional rounds. Simply repeat the process of issuing another digital asset for the second round, send one to each judge, and allow them to cast their votes.

When finished with the voting process, the BTC balances remaining in each address can be returned to the administrator's wallet.

In a real world system, a team of developers could set up a user-friendly portal for each judge and team to register and a database to hold the addresses representing each participant. The system could then have a fully automated administration process to issue the tokens and assign one to each judge.

Furthermore, the voting process could implement a simple to use interface for casting the votes and a well-formatted public page showing the results in real time.

As exemplified by our voting system, protocols such as Counterparty could be implemented for other uses such as issuing company stock, paying dividends to each shareholder based on the percentage owned, and providing real-time auditing and updates to the public.

Our voting system is one example of many, but as one can imagine, the possibilities from the Blockchain to serve our society are truly endless!

The future of finance

Looking back in history, technology has changed the world in profound ways. From the steam engine, to computers, to the Internet, we have seen amazing advances in how we can innovate through technology. In line with the previous advances of technology, Bitcoin has the potential to bring the same scale of change to finance.

Since its launch, just months after the financial crises of 2008, Bitcoin has challenged the way we look at money and finance. Consequently, our previous notions of relying on centralized institutions to issue, store, and transfer money are now questionable.

On the basis of what we've seen from the implementation of new technologies since the industrial revolution, many of our financial institutions face major disruption. The Blockchain's distributed ledger has demonstrated its ability to replace many of the functions they currently service. Yet, to our benefit, as Blockchain's adoption increases, we can expect to see more transparency and credibility on a global scale.

We started the book with a gentle introduction to Bitcoin and how to purchase them within 15 minutes. Helping to understand the basics raises awareness of the responsibility that will be assumed when working with crypto-currencies.

Throughout the book, we explained the mechanism behind the functionality of the Blockchain. As a fundamentally new technology, the algorithms that govern the protocol bring together economic, cryptographic, and social curves to support a self-sustaining system. Most impressive is its ability to be exempted from the corruption we often see with centralized power.

Finally, we ended with examples of how it can be extended with alt-coins and how it can be used in various real world applications. The possibilities with Blockchain technology and how it can be adapted are truly endless. Although anyone can start a new alt-coin today, only those that bring true value to the market will succeed.

Today we have front-row seats to a historic transformation. Each one of us plays an active role in this transformation by our choices and actions; as a collective, we can shape the system to empower every individual. Presently, we have the power to improve conditions for economic globalization for us today and tomorrow for future generations.

May the future of finance ultimately serve humanity and the planet it depends on!