This article covers:
1. What are “Bitcoin” and “Blockchain”?
2. Creating your own blockchain application with micro:bit
Image source: makecode.microbit.org
“Bitcoin” and “Blockchain” are very popular terms recently. I heard Bitcoin has risen again, and there are many other coins. Have you bought some? What exactly is Bitcoin, and can it be spent? What is “Blockchain”? It is said that many big companies are researching blockchain, and it seems that blockchain technology will be used in many areas in the future. If you don’t understand blockchain, you might feel embarrassed to greet others. Is there a simple way to understand what “Blockchain” technology is?
Knowledge Supplement: Bitcoin and Blockchain Technology
In simple terms, “Bitcoin” is a virtual currency, similar to various virtual game currencies, point cards, and Q coins on the internet, but the biggest difference is that “Bitcoin” is based on blockchain (Blockchain) technology.
Image source: Baidu Encyclopedia
Blockchain has three basic characteristics: 1. A string of data generated using cryptography, ensuring it cannot be tampered with; 2. Data is generated using the same algorithm on all nodes, mutually recognized (distributed computing); 3. During the data exchange process, mutual recognition is established through certain protocols, and this process is recorded on all nodes.
It sounds complicated, so let’s use Bitcoin as an example. The inventor of Bitcoin created a rule that calculates a string of numbers through cryptographic algorithms, declaring this as Bitcoin. Anyone who calculates the number in the same way can generate Bitcoin, but it must be recognized by everyone who uses Bitcoin for it to be acknowledged. Moreover, every transaction of Bitcoin must be recognized by all users to be valid. Everyone has a small ledger recording where this Bitcoin was generated, how many times it has been exchanged, and all these processes are recognized by all users. Therefore, although Bitcoin is virtual, it has gained recognition from all users, becoming a medium of exchange accepted by everyone, similar to traditional currencies issued by banks or large companies, thus acquiring the function of credit currency.
Image from the internet
Today, we will use the micro:bit kit, which even elementary students can play with, to create our own blockchain application. You will soon understand what all these “coins” are about.
micro:bit is a micro programmable computer based on the ARM Cortex-M0 chip, launched by the BBC in collaboration with many companies. Its original intention is to allow every child to access computer programming without any prior knowledge. The entire micro:bit circuit board is smaller than a business card, featuring an accelerometer, magnetometer, light sensor, Bluetooth and USB interfaces, a 5×5 display made of 25 LEDs, and 2 programmable buttons, powered by USB or an external power source. It also has Bluetooth and 2.4G wireless transmission capabilities. We have introduced many interesting projects built with micro:bit in previous articles, such as compasses, Morse code transmitters, etc.
Image from the internet
Materials and Tools List:
-
2 or more micro:bit mainboards
-
micro:bit data cable
-
A computer with internet access
Production Process
Step 1: First, understand the design principles of micro:coin
The Microsoft micro:coin project is an open-source project on the Microsoft Makecode platform that implements blockchain functionality on micro:bit using 360 lines of JavaScript code. You can run it by copying the code to micro:bit. It is set that shaking is mining, which will generate a string of data through a hash algorithm, randomly determining whether a coin is mined. Once a coin is mined, it will be transmitted to other micro:bit devices via 2.4G wireless broadcasting, and if received, it will be recognized. Pressing the A button on the micro:bit displays the number of coins owned (not necessarily mined, but those that have been mined and recognized), while pressing the B button shows the total number of coins that have been transmitted and recognized among all micro:bit devices.
Step 2: Enter the blockchain functionality package on the Microsoft Makecode platform
The micro:coin source code is written in JavaScript and cannot use graphical programming tools. However, recently, Microsoft’s Makecode platform has packaged it into a functionality package. Open the online programming platform at https://makecode.microbit.org/, click the upper right corner on “Settings” – “Add Package”, search for a package called “radio-blockchain” to import the blockchain module. Then, you can use drag-and-drop to perform graphical programming.
Step 3: Import the micro:coin code into each micro:bit mainboard
Since the source code has been packaged into a functionality package, we can simply drag and drop on https://makecode.microbit.org/ to implement basic functions such as mining, displaying the number of coins owned, and displaying the total number of coins in the blockchain (chain length) on micro:bit. The modular programming is as shown in the figure below. Finally, save the code file as a .Hex file and copy it to each micro:bit mainboard to complete the process.
Now, your self-built blockchain currency micro:coin can be played with. Power on several micro:bit devices that have been programmed, shake one of them, and if a coin is mined, it will display a diamond graphic while the other micro:bit receives the signal and displays a square graphic. A coin is generated and recognized throughout the blockchain. Continuous shaking will generate more and more micro:coin, but remember to keep the micro:bit devices close to each other to ensure the signal is received and recognized!
Click the link at the end of the article to download the source code for the micro:coin blockchain application.

Handaxe Maker
The handaxe may be the earliest tool made by humans. From stone tools and wooden sticks to 3D printing, let’s joyfully create something just like our ancestors did.
