Blockchain circle

One stop hot information platform

About us:

Blockchain circle provides the latest information about blockchain, digital currency, digital wallet, exchange, metauniverse, bitcoin, Ethereum, contract, financial management and so on, and always pays attention to the latest market...

Making blockchain,Implement blockchain by yourself

Time : 22/10/2021 Author : jm40vu Click : + -
        200 lines of code realize a minimum workable blockchain, and 1500 lines of code realize a cryptocurrency network system. If you can't understand blockchain this time, hit me! If you understand, you reward me. Give me a star at the top right of GitHub project to show encouragement!. The name of the project we built is naivecoin. The development language used is typescript. It is divided into six chapters. You can select the corresponding branch to view the corresponding code. If you are only interested in the implementation principle of blockchain, you only need to read the first chapter. The code is quite simple. Only 200 lines of code can give you a glimpse of the whole blockchain.
 
        In this chapter, we will use about 200 lines of code to implement a simple but complete blockchain, and lead you to understand the basic principles of blockchain. In this chapter, we will add the support of proof of work (POW) to our toy blockchain. In the version of the first chapter, anyone can add a block to the blockchain without any proof of workload. After we introduce the workload proof mechanism, a node must solve a powpuzzle with considerable computation before adding a new block to the blockchain. To solve this puzzle is usually called mining.
 
        In this chapter, we will introduce the transaction mechanism in cryptocurrency. With the transaction mechanism, our blockchain will turn from a blockchain with only basic functions to a cryptocurrency system. Finally, we can conduct cryptocurrency transactions with the corresponding users by specifying the address of the target user. In the previous chapter, if we want to account for a transaction, we must manually mine it before adding the transaction record to a block. In this chapter, we will introduce the mechanism of pending transaction relay. With this mechanism, when we want to make a transaction, we don't need to mine by ourselves, but send our transaction to our blockchain network (that is, the concept of relay transmission). After mining, other nodes add our transaction records to the new blocks they dig out.
 
        These transactions are called "outstanding transactions". A typical example is that when a user wants to initiate a transaction (send a certain amount of money to the specified address), he will broadcast the transaction to the whole network and hope other miners to put the transaction in the block.
 
        
Previous:Coin app blockchain (what are the TV dramas starring in the translation of coin app blockchain)
Next:No more

Related articles:



© 2005-2032 | Blockchain Circle & & All Rights Reserved    Sitemap1 Sitemap2 If there is infringement, please contact us at: