Initial exploration of blockchain and ant open alliance chain

Initial exploration of blockchain and ant open alliance chain


Recently, a blockchain application was added to the second-phase plan of a project that the author participated in, but the author, like most developers, only “just hear the name” about the blockchain. Especially in recent years, the concept of blockchain has become more and more popular. After a few days of preliminary research, I probably have some understanding of it.

1. Blockchain related concepts

Official concept:
Blockchain is a new application mode of computer technology such as distributed data storage , point-to-point transmission , consensus mechanism , and encryption algorithm . The so-called consensus mechanism is a mathematical algorithm that realizes the establishment of trust between different nodes and the acquisition of rights and interests in the blockchain system.
Blockchain is an important concept of Bitcoin . Blockchain is the underlying technology and infrastructure of Bitcoin. It is essentially a decentralized database and also serves as the underlying technology of Bitcoin. Blockchain is a series of data blocks associated with cryptographic methods. Each data block contains information about a Bitcoin network transaction, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.
Personal understanding:
Take a slightly simpler example:
traditional centralized concept: bank transfer. If A wants to transfer 100 yuan to B, then A needs to operate his own bank account to complete the transfer business, and at the same time, his account balance will be reduced by 100. After a short wait, B will receive a transfer of 100 yuan from A, and his bank account will be increased by 100. So who is responsible for the increase and decrease of account balance (bookkeeping)? The answer is definitely the bank. Yes, the bank is the center, and all businesses are carried out around the bank.
Blockchain (decentralization): It is still a transfer issue, involving five people in ABCDE. A transferred 100 yuan to B, and B recorded a bill after receiving it, but the three of CDE didn't know it yet. At this time, A broadcasted the transfer operation to everyone on the network, and CDE also recorded this operation in its own bill. After a while, B transferred another 200 to A, and at the same time told CDE, then CDE also recorded the transaction on the bill. Everyone has a bill in their hands, recording every transaction record. (This is decentralization) In this way, over time, many transactions have occurred between ABCDE and many transaction records have been generated. Everyone on the network knows these bills, and these bills are carried out every ten minutes. Pack, pack into a block, that is, block. The block contains all transaction records generated within ten minutes. After the block is packaged, this block will be linked to the back of the previous block, thus forming a chain, and thus the concept of a block chain. PS: The person responsible for packing the block is called the miner. Someone may ask, A and B transfer, why does CDE keep accounts? This involves Bitcoin-related issues.
The reward regulations of the blockchain: the person who packs the blockchain-the miner, will receive the corresponding Bitcoin reward when packing the block. Every ten minutes, when a block is packaged, 12.5 bitcoins will be generated to reward those miners who packaged it.
Someone must have asked again, with so many miners, who is qualified to pack blocks and get Bitcoin?
The designer of the blockchain Satoshi Nakamoto designed a mechanism-POW proof of work. That is to say, everyone who wants to keep accounts and pack blocks has to do a super difficult math problem. It is too difficult to rely on people to solve. It must pass a super high-level computer, which is the mining machine we later know. To be done. Whoever can complete the math problems the fastest will get the right to package and get the final bitcoin reward. This also explains why so many miners spend huge sums of money to buy high-performance mining machines to mine. (On the first day of learning blockchain, I didn't understand the concept much, but I read a lot of mining stories)

2. AntChain related experience

Let's first look at what Baidu said: Ant Blockchain is a representative technology brand of Ant Group. The brand has been upgraded to ANTCHAIN, which is committed to building a cloud of trust in the new infrastructure of the digital economy. . .
In general, if the leader wants to use the ant chain, let's study it first. Log in to the official website of AntChain, after the registration account approval is completed, I have a simple experience. In general, the documents are quite complete, but at the beginning of the operation, it is still a little bit of a circle. For official documents, please see: https://antchain.antgroup.com/docs/11/143566 The
main products involved are the Antchain Bass platform and the open alliance chain. We are using an open consortium chain. Because the business involved in our project is the simplest way of depositing on the chain, the application is relatively shallow. The setup process can basically be completed according to the document prompts. It is recommended to run the official demo first, and then adjust it slowly according to your business needs.
Generally speaking, after setting up the environment, configure the ant chain related information in your own development environment, and then save the required information on the chain according to the template you designed, which will consume some fuel (there is a gift at the beginning), and then it will return a ha Hope value, according to this hash value, the saved related information can be queried on the official website of Antchain. At the same time, you can also call the openAPI of the AntChain (calling the interface needs to find the technical support of Ant to open, generally 1-2 days for review time, hurry up and wait slowly), generate a QR code based on the returned hash, and scan it with Alipay The QR code can also query information on the chain. The traceability QR code of some products on the market is probably such a process, but they may store more things, and at the same time, the cost is not small.
At present, the experience of AntChain is relatively shallow, and I will add it when I study it.

Guess you like

Origin blog.csdn.net/weixin_43665271/article/details/109576719