Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cryptocurrency based on Hyperledger

Does Hyperledger Fabric support possibility to create a cryptocurrency like well know Bitcoin/Ethereum? I don't mean tokens which I can implement by chaincode.

like image 803
Kirill Bulgakov Avatar asked Aug 02 '17 11:08

Kirill Bulgakov


Video Answer


1 Answers

You can implement any business logic by using Hyperledger Fabric chaincode, which essentially a simple program. Chaincode manages ledger state by operation on transactions submitted by application and ensure to have it consistent across network peers.

Hyperledger Fabric currently supports chaincodes written in Go, while in a future will be added support for nodeJS and Java. Chaincode interface defined as following:

// Chaincode interface must be implemented by all chaincodes. The fabric runs
// the transactions by calling these functions as specified.
type Chaincode interface {
    // Init is called during Instantiate transaction after the chaincode container
    // has been established for the first time, allowing the chaincode to
    // initialize its internal data
    Init(stub ChaincodeStubInterface) pb.Response

    // Invoke is called to update or query the ledger in a proposal transaction.
    // Updated state variables are not committed to the ledger until the
    // transaction is committed.
    Invoke(stub ChaincodeStubInterface) pb.Response
}

So you can implement your cryptocurrency into chaincode. To get an inspiration on how you can implement it, you might want to take a look on following demo application of balance-transfer.


like image 183
Artem Barger Avatar answered Sep 28 '22 08:09

Artem Barger