☞ Source code is available on GitHub:
Proof-of-work will secure our blockchain against spammers and people trying to tamper with our blocks.
Mining rewards steadily introduce new coins into the system.
OOPS, I made a small mistake! In the minePendingTransactions() method, you have to pass the hash of the previous block when you’re creating a new Block() instance. This was fixed on GitHub:
Transactions on a blockchain have to be signed with a private key. This makes sure that people can only spend coins if they have the private key of their wallet.
We’ll use the secp256k1 elliptic curve to generate a keypair. The same algorithm used in Bitcoin. But you can use other algorithms as well.
Blockchains are hard to understand, so let’s visualize their inner workings by building a front-end application in Angular. I’ll show you how to visualize blocks on the chain and the transactions inside them. We’ll also make a UI to create new transactions and to mine new blocks.