Читать книгу Cryptocurrency All-in-One For Dummies - Peter Kent, Kiana Danial - Страница 171

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.

A smart auction is a type of smart contract. Its function is to transfer ownership of an item after predetermined parameters of the agreement are met.

Cryptocurrency All-in-One For Dummies

Подняться наверх