C'est un projet que j'ai commencé pour mieux comprendre :
- la proof of work
- la signature des transactions
- la création, mise à jour et validation de la chaine
- le mécanisme clé publique/clé privée
“Gold? yellow, glittering, precious gold? No, gods, I am no idle votarist: roots, you clear heavens! Thus much of this will make black white, foul fair, Wrong right, base noble, old young, coward valiant. Ha, you gods! why this? what this, you gods? Why, this Will lug your priests and servants from your sides, Pluck stout men's pillows from below their heads: This yellow slave Will knit and break religions, bless the accursed, Make the hoar leprosy adored, place thieves And give them title, knee and approbation With senators on the bench: this is it That makes the wappen'd widow wed again; She, whom the spital-house and ulcerous sores Would cast the gorge at, this embalms and spices To the April day again. Come, damned earth !”
Implementation of a BlockChain Miner Node, and a Complete Fake Client Wallet :
- Creation of Private and Public Key
- Creation Script
- Build a complete Transaction
- Synchronization of the differents Nodes
- Proof of Work
- Verification and update of the BlockChain
- Manage the creatopn of a Fork BlockChain
- Create a maintainable and well organised code
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to install Node JS and Python. I have used a Mac OS's laptop to create this application.
Copy the repository. Go to the repository in your computer. Then type the following :
sh settle.sh
Then open 4 terminals screens. In the first screen type the following
node Miner1.js
And repeat for the second screen
node Miner2.js
And then for the third screen
node Miner3.js
For the last one go to the folder WalletClient then
node WalletClient1.js 1
node WalletClient1.js 2
node WalletClient1.js 3
node WalletClient1.js 4
Theses last command will send 4 transactions to the three Miner Node
To send a request to the Miner Node to retreive the BlockChain and check if the BlockChain are the same in the 3 node do the following when you are in the folder WalletClient
cd IntegrityBlockChain
node RequestBlockChain.js
The three node will write the BlockChain in the log file like for example Log3005.txt Then type :
sh diff.sh
This project is licensed under the MIT License - see the LICENSE.md file for details
- Inspiration : David Derosa’s for the explications of how works a WalletClient
- Inspiration : Mastering Bitcoin of Andreas M. Antonopoulos to understand the whole system of the BlockChain
- Inspiration : lhartikk/naivechain to start with a simple BlockChain in node JS
- Inspiration : https://www.miximum.fr/blog/cryptographie-courbes-elliptiques-ecdsa/ to understand the elliptic curve if you speak french.