Where smart contracts are on the blockchain (Ethereum or Hyperledger)

So, let’s look at a typical trade finance process flow. The exporter deploys a contract that has shipping conditions, and a hash is generated after deployment is complete.

Questions:

1) Where is the contract stored?
2) How can other participants, such as customs and importer, gain access to this contract?
3) Can we activate member level access to a blockchain contract?

+6
source share
2 answers

There are several aspects to Ethereum and Hyperledger that make them completely different. Let me give a slightly simplified answer so as not to get too many details and too long an answer.

First of all, Ethereum is, first of all, a public blockchain that works in a certain way. Similarly, blockchain works in a certain way. Hyperledger is not like this, rather it is an umbrella for distributed accounting technologies (in my terminology it’s not the same as a block chain), which are all aimed at creating a very flexible architecture that allows you to create all kinds of systems with support for books with almost any properties you need . You can compare this with the imaginary probe Bitcoin, which provides technology for the production of its own altcoins with plug-in parts, for example. consensus, chain store, node composition, etc. In short, they are all aimed at solving various problems, and one should not think that everyone will correspond to everyone.

Returning to your questions.

1) Where is the contract stored?

Ethereum has contracts (called smart contracts) in the chain, that is, the code is compiled into byte code, and the received bytes are sent inside the transaction, which must be stored in the Ethereum blockchain. This is done once during the deployment of the smart contract. After that, you can interact with the smart contract with other transactions.

Hyperledger does not theoretically determine whether it can be in a register or not. For example, Take Fabric, it deploys the code into an isolated Docker container, which can then interact using transactions.

2) How can other participants, such as customs and importer, gain access to this contract?

The short answer is that they are granted access through credentials.

This is in both Ethereum and Hyperledger, so you decide. Now we assume that the code in both cases was deployed as code on a blockchain for Ethereum and as a Docker container in Fabric.

In Ethereum, the code is a bit simplified, public / visible, which means you need to use some kind of check to allow those who should be able to interact with the smart contract to do this. One way is to check the sender (transaction) and allow only certain ones. It is similar to traditional systems where authentication / authorization is usually required in order to allow and see / modify data.

In Hyperledger, this is most likely to be modeled in a similar way and, for example, in Fabric, there is also a Certification Authority, which transmits certificates that allow access to various parts of the system. For instance. transport, endorsement or transaction.

3) Can we activate access at the participant level to the contract on the block chain?

Yes, therefore, each participant in both systems has credentials, and the smart contract developer can use this to control access.

In addition, Fabric has channels that share the register used for access control.

NTN.

+9
source

1) The contract is on the general ledger. Whenever a transaction is invoked, the corresponding method in the contract is executed at all peer-to-peer nodes.

2) Other participants can access this contract using their predefined user credentials, which they can use to register and call transactions under the contract.

3) Yes, we can activate access at the participant level to the contract by defining attributes for each user and allowing only those users who have certain attributes to access certain parts of the contract.

+4
source

Source: https://habr.com/ru/post/1014755/


All Articles