Block chain development: block chain advanced

Source: Internet
Author: User
Storing extra data

Storing additional data on a block chain refers to data that exists on the block chain but has no impact on the transaction, and there are two main ways to store additional data: Op_return and Multi-signatures. Op_return

A new feature was introduced in the Bitcoin protocol in 2013, which was to create a transaction called Op_return that could embed 40 bytes of data (currently 80 bytes). Initially this feature was designed to add to the Bitcoin transaction information such as distribution information, and later developed the usage today: Create a transaction with a minimum (0.000000001btc+ transaction fee) and embed the information in it. An interesting application of this feature is the existence proof (Proof of existence), which creates a hash for any file and then stores it on the block chain, which ultimately proves that the file exists at some point by comparing the timestamp and the hash. But the disadvantage of this approach is that the bitcoin sent through the transaction cannot be reused, which means it is permanently gone. Multi-signatures

A multiple signature address is another way of storing data, for the n-of-m type of multiple signature address, because only need to provide n valid signatures can cost the transaction, but the remaining M-n signed content or allocated storage space, if not filled out then back with 0 fill, we can change 0 to the data we want to fill , the advantage of this approach is that the transaction can still be spent. side Chain (sidechains)

The side chain does not refer to a particular block chain, but to all the block chains that follow the side-chain protocol, the word is for the bitcoin main chain. Side-chain protocol is a kind of protocol that can let Bitcoin transfer from the main chain of Bitcoin to other block chain, while the currency of other block chain can be returned to the Bitcoin main chain.

At present, the side chain is mainly through the wedge-type side-chain technology (pegged Sidechain) to achieve, mainly by the Blockstream company responsible for development, the detailed content can be referred to the paper "enabling Blockchain innovations with pegged Sidechains, the side chain generally has the following attributes: The assets moved between the side chains should be able to be moved back by the current owner, but no one else can (including the previous holder). The movement of assets should be free of counterparty risk; that is to say, the dishonest side cannot prevent the transfer from happening. The transfer of an asset should be atomic, that is either complete or not at all. The absence of any other chain will result in the casting or theft of assets. The side chain should be completely independent, and the data needed on the other chain should be fully supplied by the user. The verifier of the side chain should only follow the other chain when the explicit consensus rules of the side chain itself are required. Users should not be required to track the side chains they are not actively using.

The process of side chain implementation generally includes the following four stages: Send the lock transaction, the bit currency locked in the bitcoin main chain. Waiting for the confirmation period, the role of the confirmation period is to wait for more blocks to confirm the lock transaction, prevent fake lock and denial of service attacks, lockout time is 1-2 days. Redeem Bitcoin on the side chain. After the end of the confirmation period, the user creates a transaction on the side chain to spend the lock on the output of the transaction, and provide a SPV work proof, output to the address on its side chain, this transaction is also called redemption transaction. Waiting for a competition period, the role of the competition is to prevent double payments, during which the new transfer of the currency can not be spent on the side chain.

After the competition period is over, the redemption transaction is packaged into chunks and users can use their own SGD. The same is true of the process of transferring Bitcoin from the side chain. Contract currency (counterparty)

The contract currency is essentially a transport-layer protocol based on Bitcoin, which uses the Bitcoin block chain as a trusted timestamp service and a trusted message release certificate, the main purpose of which is to establish and use the centralized financial instrument agreement. The currency within the agreement is the contract currency XCP, the contract currency is not generated by the mining, but through the combustion proof proof of burning by burning the Bitcoin, the burning process was completed in January 2014, the total burning of 2,130 bitcoin (https:// BLOCKCHAIN.INFO/ADDRESS/1COUNTERPARTYXXXXXXXXXXXXXXXUWLPVR), produced 2.6 million XCP, each XCP transaction contains the following information: Source address Destination address a certain amount of Bitcoin + transaction fee Up to 40 bytes of Go data, which is embedded in the bitcoin transaction in the first two ways of this chapter.

For the convenience of distinction, the data area of each contract currency transaction is preceded by the UTF-8 format Cntrprty to differentiate between the contract currency transaction and the Bitcoin transaction. The source and destination addresses in the contract currency transactions are in fact Bitcoin addresses, and any Bitcoin address can receive any contract currency assets. The contract currency has now implemented the following functions: Sending assets: XCP or custom assets. Custom assets: Issue user-defined currencies or assets to pay dividends and so on. Distributed transactions: The use of XCP,BTC or other assets to trade with each other. Gambling and financial derivatives: betting or structuring smart contracts. Turing's complete intelligent contract platform: With all the features of the etheric Square, and compatible with each other.

All transaction types and data information of the contract currency can be viewed through https://xchain.io/, official documentation reference: https://counterparty.io/docs/.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.