Return to Web Labs at ReactorLab.net

Cryptocoin Blockchain - Teddy Token

This is an interactive simulation of the Teddy Token cryptocoin blockchain. This chain was started by Catoshi Purramoto in honor of his fellow feline Teddy.

GO TO THE SIMULATION >> Teddy Token

FIVE STEPS to building the blockchain:

On opening the simulation, only the "Genesis Block" is present in the blockchain field on the far right or far bottom of the page, depending on your screen size and orientation. The Genesis Block is block number 0, in which Catoshi created tokens and distributed them to 5 friends.

  1. Create a transaction: Select To, From and enter an amount. Transactions show the addresses, not the names of the people to whom the address belongs. This makes transactions anonymous.

  2. Verify the transaction: This step checks to make sure two different addresses have been entered and a nonzero amount that is less than or equal to the current balance of the From address has been entered. After verification, the transaction is added to a pool of pending transactions on the peer network.

  3. Build block: This step checks to make sure you have entered at least two verified transactions, then creates a provisional block. Real blockchains have blocks with thousands of transactions in order to reduce the cost per transaction. Miners on the peer network collect pending transactions and form provisional blocks.

  4. Mine block: This step performs computations in order to achieve consensus on which provisional block created by miners should be added to the blockchain next. Since a real peer network will have many miners, each of whom can build a provisional block, they must reach consensus on which block to add next. The block of the first successful miner is added to the blockchain and they receive a reward of new tokens created by the blockchain algorithm.

  5. Add block to chain: This step adds the new block to the top of the blockchain and also updates the balances of all users in the blockchain header.

ABOUT

Teddy Token's purpose is to show, in a simplified way, how blockchains and cryptocoins work. See below for a partial list of differences.

Blockchains are a sequential record of transactions [ref], which may be simple transfers of cryptocoins, as in the case of Bitcoin and Teddy, or contracts in the form of computer algorithms [ref], as in the case of Ethereum [ref].

Hashes are key to blockchains. They are values created by cryptographic hash algorithms operating on information such as blockchain transactions [ref]. They ensure that any future change in information, such as how many coins you have sent me, becomes obvious by a large change in the hash of the information, thus preventing tampering with the blockchain.

See Web Lab 17 for a demonstration and explanation of hashing. A user's anonymous address is the hash of the user's public cryptographic key. See Web Lab 16 for a demonstration and explanation of public-key cryptography.

Each block of transactions, as well as each individual transaction in a block, is identified by a hash value that prevents the transaction and the blockchain from being tampered with. The hashes also allow individual transactions and blocks to be located in the blockchain. Each block contains the hash of the previous block such that tampering with any block changes the hashes of all successive blocks, thus allowing identification and location of the problem. Since only the block header is hashed, the header includes a hash - the Merkle root [ref] - of the transactions to prevent tampering with them.

Of many methods available to achieve consensus on which block to add next, the one used by Bitcoin [ref] and Teddy Token is "proof of work" [ref]. This requires the miner to find a number which they add to the block header such that the hash - a code representing the block header - starts with the target number of zeros. This number is called the nonce: a number used once. The first miner to reach the target can add their block to the blockchain and earn the block mining reward. The target here is a small value so that the mining is fast. Real blockchains require a target value of many zeros such that mining requires significant time and computer power.

Cryptocoins have several additional advantages in addition to that of security. They can be exchanged anonymously through the hash addresses, which cannot be reverse engineered to discover the owner. They can be exchanged at small cost compared to bank transfers. Their value is that perceived by all users and not directly dependent on government policies.

The first cryptocoins were created out of thin air. Satoshi Nakamoto [ref] created the initial 50 bitcoins out of thin air by typing a number into a computer program. Catoshi Purramoto created his tokens likewise. The total numbers of bitcoins and Teddy tokens increase only as a result of the block reward coins and tokens created by the blockchain algorithm and given to miners. Although the initial coins were "free," further coins require the expenditure of energy in mining, which, in the case of Bitcoin, has become a noticable percentage of the world's energy budget: 0.5% in 2021 according to Cambridge University [ref].

For what do people trade cryptocoins? Things of value, which they give in order to receive cryptocoins in payment. The first purchase with bitcoins is said to be that of a pizza [ref]. People also will sell their coins in exchange for government currency, e.g., U.S. dollars. Government currency is termed "Fiat" currency in the cryptocoin world [ref]. Fiat currency is not backed by a real asset such as gold, and depends on user confidence for value. Hmmm, that description also applies to cryptocurrency...

There is no fixed price for cryptocoins. The coins are auctioned such that their value in government currency fluctuates with the perceived value of the coins. The real cost of electricity to mine sets a base price.

In the Teddy Token simulation, the wallets field shows a snapshot of the wallet of each of the users. Real users can only view their own wallet, which also contains their list of transactions and private and public encryption keys. Their address is the hash value of their public key. Computers of users and miners are distributed throughout the world in a peer-to-peer (P2P) network over the Internet.

Bitcoin started with only 50 coins and will max out at 21 million coins as the block reward decreases with time to zero. For the first year or so after the start of Bitcoin, the blocks mined contained only mining rewards. This built up the supply of bitcoins such that a suffient number existed for people to start trading bitcoins. The block reward stays constant in Teddy so there is no limit, other than your patience, to the number of tokens.

Summary of differences between Teddy Token and real blockchains

  1. Teddy Token is self-contained in your web browser. Real users and miners are distributed around the world and connected in P2P networks over the Internet.

  2. There are only five users in Teddy Token. Real blockchains may have thousands or millions of users.

  3. You can see everyone's names in Teddy Token. Real users cannot see information about other users except their anonymous hash addresses and transaction amounts. That is, everyone's identity is hidden.

  4. Each Teddy Token transaction involves only one input and one output. Real transactions can involve more than one input and output.

  5. Teddy Token blocks require a minimum of only two transactions, in addition to the miner reward. Real blocks may involve thousands of transactions.

  6. Teddy Token uses the "proof-of-work" consensus method for verifying and accepting blocks, as does Bitcoin. There are many other consensus methods in the blockchain world [ref].

  7. The target value in Teddy Token is small to make mining fast for your convenience. The larger the target value - the number of zeros required at the start of the final block header hash - the more computation it takes to find the nonce. The Bitcoin target is increased periodically as computers get faster in order to keep the mining time at approximately 10 minutes per block.

  8. Transactions are free to process in Teddy Token. Real blockchains can charge a transaction fee to the sender.

  9. The total number of Teddy tokens is limited only by your persistence, since the block mining reward is constant. The total number of bitcoins is limited to 21 million by the eventual reduction to zero of the block reward. At that time, miners will continue to receive transaction fees from users.

  10. The format of entries here is simplified in order to help understanding. Actual formats involve various number formats and field names, etc.

GO TO THE SIMULATION >> Teddy Token

Teddy