Cryptocurrency based on Hyperledger

血红的双手。 提交于 2019-12-06 03:44:24

问题


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.


回答1:


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.





回答2:


There is a Token feature in the alpha release of 2.0, you can check it out: https://hyperledger-fabric.readthedocs.io/en/latest/whatsnew.html#fabtoken

Also check here for

Can we create non-fungible tokens with Hyperledger?

The platform-neutral Token Taxonomy Initiative overseen by the Enterprise Ethereum Alliance (EEA) has announced the publication of the Token Taxonomy Framework (TTF) V 1.0, which enables businesses and developers to universally understand and define what a token is in non-technical terms, regardless of how it is implemented.



来源:https://stackoverflow.com/questions/45459696/cryptocurrency-based-on-hyperledger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!