Читать книгу Cryptocurrency All-in-One For Dummies онлайн

179 страница из 200

Working with Smart Contracts on Hyperledger

A smart contract is computer code that is written inside a blockchain protocol. Smart contracts are created to facilitate, verify, or enforce the prenegotiated terms between two or more parties. The blockchain protocol takes the place of enforcement of contracts. Smart contracts, in effect, allow two or more parties to work together without trust or the need to have authoritative judgment or settlement if things go wrong. At least that’s how they work in theory. Many different platforms enable smart contracts. On Hyperledger, they’re called chaincode.

Chaincode is conveniently written in Go, node.js, and Java and runs in a secured Docker container. Unlike other smart contract platforms that must expose your contract to a public network to enforce them, chaincode is isolated from the endorsing peer process of public blockchains. This allows you to keep your business logic private.

Another feature that distinguishes chaincode from many other platforms is that each chaincode contract is isolated. Other organizations using Hyperledger can’t access your chaincode directly unless permissioned. This feature may reduce attack vectors on your contracts by keeping third parties from accessing them.

Правообладателям