How do I use blockchain to develop a landing project? This practical Daniel teaches you

Source: Internet
Author: User
Tags hyperledger fabric

blockchain is a relatively hot new concept, which implies the two-layer concept of technology and finance. taking the alliance chain as an example, this paper simply describes the basic process of practicing a chain of alliances.



Author | Chen Hao, CTO, SC Blockchain


first of all to determine the type of blockchain, is a notary block chain or value type.


A notarial blockchain is a blockchain that is limited to some key data, such as self-certification, disclosure and tamper-proofing, and is usually included in the value-based blockchain, and can be expanded separately for public disclosure. Value-based blockchain refers to an accounting ledger that can transfer ownership of assets.


If a value-based blockchain is identified, we need to determine the overall positioning of the target blockchain: whether it is a universal value-transfer blockchain or a blockchain in a particular scenario. If the blockchain is a specific scenario, we usually recommend the super-Ledger as a technical prototype, and if it is a more generic value block chain, we recommend Ethereum's approach.


Construction and preliminary analysis of business scenarios


The first point to make clear is that the blockchain is not omnipotent. Many scenarios do not need to be solved by blockchain technology. Like cross-border payments, blockchain can be very good because there are a lot of point-to-point cross-border agencies have a large number of payment liquidation needs, but do not want to participate in the intermediary, blockchain is a good choice. But within some groups, within large companies, blockchain solutions are substantially less than traditional enterprise resource solutions.


A, demand pain point analysis


General demand pain points when the following conditions are met, consider using blockchain:

There is a non-trust peer network environment;

The nodes are reciprocal and there is no absolute arbiter;

Between the nodes is the game behavior.

The peer network may contain inputs and outputs, and the blockchain is no longer closed when it contains inputs and outputs.


There are generally several behaviors (including but not limited to) for a node:

Do not trust other nodes;

To ensure the maximization of their own profits;

Selfishness acquires but does not contribute resources.

For the business modeling of the above scenarios, it is necessary to derive a solution to meet their own needs according to the specific business logic and game theory.


B, non-blockchain technology can solve


Case 1:


Usually we have different institutions A, B, C, there is asymmetric information exchange requirements, that is, A, B, C have part of the data, but the three are combined to have a market of full-volume data. But as a, want to know whether B, C have their own data set of some point data, according to this result to adjust their purchase strategy.


Case 2:


There are different agencies X, Y, z, there is a demand for information feedback, when Z receives the service of Y, will give y a feedback, this feedback may be credit evaluation, may be just response feedback. In short, this feedback needs to be documented, and X adjusts its purchasing strategy based on the feedback from Z. When X buys the service, it also gives y a feedback, and Z also receives feedback.


The above two cases first consider whether the use of non-blockchain can be resolved:


For Case 1, sensitive data and private data are not exposed, even if encryption is not allowed to be uploaded to the blockchain. Therefore, a data input and output block chain process is generated, the process is not controllable block chain.


Is it possible to control the use of traditional techniques? It does not seem to be able to meet the non-exposure of sensitive data schemes are only hash calculation and homomorphic encryption. But both require data transfer to the specified location.

Typically we will consider using 0 knowledge proofs as a solution, however the specific algorithm may need to be built according to the specific business logic, combined with a simple smart contract to produce different outputs based on the query results.


For Case 2, the feedback information is easy to be tampered with, can be brushed single and other issues are the largest, how to ensure that this information feedback is objective neutrality can not be tampered with, and the blockchain tokens of the currency age to make the transaction has the direction to prevent cheating behavior.



Modeling Business Scenarios


For the second section of the two cases, we are going to model, remove the core pain point, we must also have the requirements of accounting, in essence, in any case each node is both a service side, and customer side, then how to measure their contribution and how much to claim.


Therefore, any blockchain platform must have a token system, otherwise the accounting will be very difficult. In the business scenario modeling process, we focused on how to make Pareto improvements between nodes, not because each node is selfish, so that the blockchain service is not in the list.


Development Path


A, block chain prototype selection


According to the narrative at the beginning of this article, if it is a blockchain solution for a particular scenario, it is recommended that hyperledger fabric be built, but it is also possible to build the Ethereum private chain. Here are some examples of ethereum and fabric comparisons:


Ethereum is the same point as Hyperledger:


Are the platform to provide the blockchain business implementation, the business implementation is through the intelligent contract to achieve maximum flexibility and the bottom of the non-modification.

Ethereum is: EVM virtual machine, solidity contract language;

Hyperledger is: Shim chain code container, use go to write contract.

The official version is implemented using the go language.

because of the provision of third-party programmability, due to the difficulty, internal vulnerabilities inevitably exist. There is a threat of malicious program attack on the outside. Especially when it comes to being a public chain, the threat will be even greater. Last month, Ethereum has reported a contract solidity language loopholes.


Ethereum differs from Hyperledger:


Ethereum only offers smart contract capabilities. It also coincides with its positioning: smart contracts and de-centralized application platforms. There is no underlying support for system security or access mechanisms. Hyperledger, while absorbing the features of the Ethereum Smart contract, provides membership and authentication role management modules that are closer to the commercial application scenario.

consensus mechanisms are different. Due to the different consensus, so can deal with the volume per second is not the same, Ethereum is thousand per second processing capacity, and Hyperledger can reach 100,000 levels.

the implementation of the technology is not the same way of thinking. Ethereum more is on their own to achieve, build their own wheels, a bit of the development of the sense of skill, such as their own contract language solidity, self-realization EVM (This may be the actual need).


Table 1 is the author of a private chain project in the comparison of the two (private chain considered the feasibility of Hydrachain).



According to their actual TPS needs, the reader can make a consensus selection. Table 2 is a number of reference data for different consensus.



Of course, if you consider your own development, it is recommended to set up a basic Bitcoin network, do addition, change the consensus algorithm, Network Transfer Protocol and additional contracts (optional).


In fact, the intelligent contract in some scenarios is not required, for users, reliable and convenient real-time is the first demand, if the specific application scenario, the "contract" solidified in the blockchain, is also a feasible way of thinking.


For the above two kinds of alliance chain implementation, the author also want to emphasize that not all services must be blockchain, the author conceived a general umbrella-type structure, such as Bitcoin side-chain technology, the main chain to provide basic ledger services, side-chaining to provide specific scene services, side-chain applications can be non-blockchain implementation, just interface registration can.



B, interactive interface design


In the interface design, it is recommended to use the current industry-wide JSON-RPC interface, both extensibility and friendliness.


Generally we divide the interface into two categories: Open Interface and Account interface. Open interface refers to the description of the blockchain itself, it is not required authentication, and the account interface is required for account authentication.


C, basic ledger design


The basic ledger design consists of the following two questions:


The first is whether the prototype blockchain has met the requirements. If you don't need to change the base ledger for Ethereum, just build a smart contract. If the bitcoin system is based, there may be significant changes.


How to change the base ledger when not meeting the requirements. This depends on the account model, and if you use Utxo mode, the change is focused on how to embed the template trader. If you use balance mode, then this problem does not apply.


Related Article

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.