Have you heard about BitCoin and all those new Crypto currencies? Well micro:bit has micro:coin now!
How does a micro:bit make coins?¶
Each micro:bit contains a block chain, a sequence of blocks, that is public and can’t be modified. Each block represents a coin. To mine new coins, the user shakes the micro:bit and, if they are in luck, their coin added to the chain as a new block! Once the block is added, it is broadcasted to the other micro:bit (the block chain is public and can’t be modified so it’s ok to share it). Other micro:bits receive the block, validate the transaction and update their block chain as needed.
A shows the number of block you added to the chain, that’s your score. Pressing
B shows you the length of the chain.
Coins, blocks, chains¶
A block chain is a list of blocks that record transactions of a crypto-currency like BitCoin. A block might contain information like the time it was created (mined) and who mined it. The most important part of the block is it’s hash. This is a special number made from the information in the last block of the block list combined with the hash number of previous block in the list. The new block contains information for the current transaction and this new hash number. The new block is added to the list of previous blocks. This list is then transmitted to the crypto currency network. It’s really hard (like impossible) to tamper or forge a hash which allows the block chain to be transmitted publically.
Build yourself a micro:bit wallet to hold your coins!
The code uses blocks from radio-blockchain package.
- Click on Advanced, then Add Package
- Search for blockchain and add radio-blockchain
How does the blockchain code work?¶