The Fabric Token SDK is a set of API and services that lets developers create token-based distributed application on Hyperledger Fabric.

Overview

Fabric Token SDK

License Go Report Card Go CodeQL

The Fabric Token SDK is a set of API and services that let developers create token-based distributed application on Hyperledger Fabric.

Useful Links

  • Documentation: Discover the design principles of the Fabric Token SDK.

  • Examples: Learn how to use the Fabric Smart Client via examples. There is nothing better than this.

  • Feedback: Your help is the key to the success of the Fabric Token SDK.

  • Fabric Smart Client: The Token SDK leverages the Fabric Smart Client for transaction orchestration, storing tokens and wallets, and more. Check it out.

Disclaimer

Fabric Token SDK has not been audited and is provided as-is, use at your own risk. The project will be subject to rapid changes to complete the open-sourcing process, and the list of features.

Motivation

Hyperledger Fabric is a permissioned, modular, and extensible open-source DLT platform. Fabric architecture follows a novel execute-order-validate paradigm that supports distributed execution of untrusted code in an untrusted environment. Indeed, Fabric-based distributed applications can be written in any general-purpose programming language.
Fabric does not depend on a native cryptocurrency as it happens for existing blockchain platforms that require “smart-contracts” to be written in domain-specific languages or rely on a cryptocurrency.

Blockchain technologies are accelerating the shifting towards a decentralised economy. Cryptocurrencies are reshaping the financial landscape to the extent that even central banks are now testing the technology to propose what is known as the central bank digital currency. But it is more than this. Real-world assets are being tokenised as fungible or non-fungible assets represented by tokens on a blockchain. Thus enabling business opportunities to extract more value.

Developing token-based applications for Hyperledger Fabric is not easy. Fabric does not provide an out-of-the-box SDK that let developers create tokens that represents any kind of asset. Developers are left on their own and this exposes them to useless duplication of code and security vulnerabilities.

What would happen if the developers could use a Fabric Token SDK that let:

  • Create tokens that represents any kind of asset (baked by a real-world asset or virtual);
  • Choose the privacy level that best fits the use-case without changing the application logic;
  • Orchestrate token transaction in a peer-to-peer fashion;
  • Perform atomic swaps;
  • Audit transactions before they get committed;
  • Interoperate with token systems in other blockchain networks;
  • Add a token layer to existing Fabric distributed application?

Developing Enterprise Token-based distributed applications would become simpler and more secure.

Use the Fabric Token SDK

Install

The Fabric Token SDK can be downloaded using go get as follows:

go get github.com/hyperledger-labs/fabric-token-sdk

The above command clones the repo under $GOPATH/github.com/hyperledger-labs/fabric-token-sdk.

We recommend to use go 1.14.13. We are testing the Token SDK also against more recent versions of the go-sdk to make sure the Token SDK works properly.

Makefile

The Token SDK is equipped with a Makefile to simplify some tasks. Here is the list of commands available.

  • make checks: check code formatting, style, and licence header.
  • make unit-tests: execute the unit-tests.
  • make integration-tests: execute the integration tests. The integration tests use ginkgo. Please, make sure that $GOPATH/bin is in your PATH env variable.
  • make clean: clean the docker environment, useful for testing.

Executes the above from $GOPATH/github.com/hyperledger-labs/fabric-token-sdk.

Testing Philosophy

Write tests. Not too many. Mostly Integration

We also believe that when developing new functions running tests is preferable than running the application to verify the code is working as expected.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details

Issues
  • Is there a clear version for the stack figure?

    Is there a clear version for the stack figure?

    The link is https://raw.githubusercontent.com/hyperledger-labs/fabric-token-sdk/main/docs/imgs/stack.png, which is difficult to read the words on it. Thanks!

    opened by yeasy 3
  • refactoring to make services backed agnostic

    refactoring to make services backed agnostic

    We now support both fabric and orion as backed to process the token transactions thanks to the token/services/network package that takes care of everything.

    To better reflect that some services are not backend agnostic, this issue proposes the following refactoring:

    • [x] rename token/services/ttxcc to token/services/ttx
    • [x] move token/services/tcc under token/services/network/fabric
    • [x] rename token/services/nftcc to token/serivces/nfttx
    • [x] move the content integration/token/tcc one level up, and remove tcc
    opened by adecaro 2
  • Namespace is always zkat even if it was changed in the node configuration

    Namespace is always zkat even if it was changed in the node configuration

    when adding a namespace in the configuration file of the node (not zkat),then when calling token.GetManagementService() and pass the node it will fail. it will throw error failed getting TMS for [{default mychannel zkat}] although the namespace is not zkat

    enhancement 
    opened by NorhanKhaled 1
  • auditdb: extend to owner wallets

    auditdb: extend to owner wallets

    Currently, AuditDB is used by an auditor to track token transactions. A token owner, instead, can only access the list of unspent tokens.

    This git issue asks to make the AuditDB available also to token owners in such a way they can get more information about the transactions they were involved in.

    enhancement 
    opened by adecaro 1
  • sample documentation update

    sample documentation update

    • broken links fixed
    • additional documentation to fungible, including configuration description and how to use embed the stack in an already existing application node.
    • added new GitHub action to check the links in the md files

    Signed-off-by: Angelo De Caro [email protected]

    opened by adecaro 1
  • Add token request extractor to TCC

    Add token request extractor to TCC

    Refactor TCC that the tokenRequest extract logic can be injected. This allows to use alternativ implmentations of the extracting logic other than the default transient-based logic. A use case for this is, the FPC-TCC. Currently, FPC does not support transient data, so the tokenRequest must be provided via function args.

    Signed-off-by: Marcus Brandenburger [email protected]

    opened by mbrandenburger 1
  • network.fabric: support FPC

    network.fabric: support FPC

    If the token chaincode is a FPC, then we must pass the token request as an input not via transient. This, at least, until FPC supports transient: https://github.com/hyperledger/fabric-private-chaincode/issues/666

    Signed-off-by: Angelo De Caro [email protected]

    opened by adecaro 1
  • fix p2p flake

    fix p2p flake

    sometimes the unit-tests under comm fail due to timeouts in bootstrapping the libp2p network.

    To avoid such a failure, we can give up to three chance to initialise the network properly.

    opened by adecaro 1
  • NFT support

    NFT support

    This goal of this Pull Request is manyfold.

    • Introduce a service package for NFT (nftcc). This package will augment a ttxcc transaction with methods targeting NFTs.
    • Introduce an integration test for a DvP between fungible and non-fungible tokens
    • Update the documentation

    In a subsequent PR, the integration test will be used to create a sample app.

    Signed-off-by: Angelo De Caro [email protected]

    opened by adecaro 1
  • orion integration

    orion integration

    • [ ] Introduce a new network driver for orion under https://github.com/hyperledger-labs/fabric-token-sdk/blob/481c11dce52f1e5f356fb874feaadbce0740ad73/token/services/network
      • [ ] The network driver must implement the Network interface at https://github.com/hyperledger-labs/fabric-token-sdk/blob/481c11dce52f1e5f356fb874feaadbce0740ad73/token/services/network/driver/network.go. Reuse the fabric network implementation as much as possible.
    • [ ] Update sdk.go to:
      1. Import the new driver (with an implicit import)
      2. Instantiate the token management service provider (line 83) with struct based on the network driver.
      3. LockerProvider and VaultProvider must use the network driver
    opened by adecaro 1
  • github.com/hyperledger-labs/fabric-token-sdk: no Go source files

    github.com/hyperledger-labs/fabric-token-sdk: no Go source files

    I am using Ubuntu 20.04 with 1.16 Go version. I met this issue when execute this command "go get github.com/hyperledger-labs/fabric-smart-client" Thank for your help!

    opened by RongNK 1
  • RegisterResponder function needs to have AcceptCashView{} and IssueCashView{}

    RegisterResponder function needs to have AcceptCashView{} and IssueCashView{}

    if I have 2 applications 1 is for the issuer which will issue tokens and one is for the recipient that will accept tokens , in that case I should not have the issue cash view on the recipient node side how will I configure the registerResponder ? and the same for transfer view

    opened by NorhanKhaled 1
  • unable to start Fabric network and the FSC network using ./nft network start --path ./testdata command

    unable to start Fabric network and the FSC network using ./nft network start --path ./testdata command

    Hi there am using Go version is "go version go1.16.15 linux/amd64" go build -o nft went successfull but trying to up and run FSC and fabric network getting below issue, Please help me to fix this issue.

    2022-06-23 20:39:27.793 IST [nwo.network] Start -> INFO 001 ____ _____ _ ____ _____ 2022-06-23 20:39:27.793 IST [nwo.network] Start -> INFO 002 / | | | / \ | _ \ | | 2022-06-23 20:39:27.793 IST [nwo.network] Start -> INFO 003 _ \ | | / _ \ | |) | | | 2022-06-23 20:39:27.793 IST [nwo.network] Start -> INFO 004 ) | | | / ___ \ | _ < | | 2022-06-23 20:39:27.793 IST [nwo.network] Start -> INFO 005 |__/ || // _\ || _\ |_| panic: Your test failed. Ginkgo panics to prevent subsequent assertions from running. Normally Ginkgo rescues this panic so you shouldn't see it.

    But, if you make an assertion in a goroutine, Ginkgo can't capture the panic. To circumvent this, you should call

    defer GinkgoRecover()
    

    at the top of the goroutine that caused this panic.

    goroutine 1 [running]: github.com/onsi/ginkgo.Fail(0xc0005a6040, 0x37, 0xc000c7f8d8, 0x1, 0x1) /home/masoolbabairfan/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:291 +0xc8 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric/helpers.AssertImagesExist(0x25fd230, 0x1, 0x1) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/fabric/helpers/images.go:28 +0x38f github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric.NewPlatform(0x1ab1188, 0xc0005aa240, 0x1a7f6b8, 0xc0008b0200, 0x7f32870cd758, 0xc000684bc0, 0xc0003744d0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/fabric/fabric.go:114 +0x57 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric.platformFactory.New(...) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/fabric/fabric.go:106 github.com/hyperledger-labs/fabric-smart-client/integration.(*Infrastructure).initNWO(0xc0005975c0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/integration.go:298 +0x690 github.com/hyperledger-labs/fabric-smart-client/integration.(*Infrastructure).Generate(0xc0005975c0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/integration.go:166 +0x35 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/network.Start(0xc00056da10, 0x0, 0x0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/cmd/network/cmd.go:187 +0x2b1 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/network.StartCmd.func1(0xc0003a7080, 0xc0003a9ee0, 0x0, 0x2, 0x0, 0x0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/cmd/network/cmd.go:151 +0x8c github.com/spf13/cobra.(*Command).execute(0xc0003a7080, 0xc0003a9ec0, 0x2, 0x2, 0xc0003a7080, 0xc0003a9ec0) /home/masoolbabairfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x472 github.com/spf13/cobra.(*Command).ExecuteC(0xc0003a6000, 0x17a3571, 0xd, 0x0) /home/masoolbabairfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /home/masoolbabairfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd.(*Main).Execute(0xc00056d9e0) /home/masoolbabairfan/go/pkg/mod/github.com/hyperledger-labs/[email protected]/integration/nwo/cmd/main.go:56 +0x2dd main.main() /src/github.com/hyperledger-labs/fabric-token-sdk/samples/nft/nft.go:42 +0x25d

    opened by masool 2
  • wallets restructuring

    wallets restructuring

    • NWO: drop the reuse of idemix identities defined in the fabric network
    • NWO: always generate idemix identities for owner identities
    • Remove type from wallet configuration. The type must be automatically derived by the underlying driver.
    • Remote type from RegisterOwnerWallet and RegisterIssuerWallet. The type must be automatically derived by the underlying driver.
    enhancement 
    opened by adecaro 0
  • `ttx` package: accountable `AcceptView` and `EndorseView` ack

    `ttx` package: accountable `AcceptView` and `EndorseView` ack

    Currently, the AcceptView and EndorseView of the ttx package send back an ack to confirm that a transaction has been received and approved by the recipient. This ack is not binding.

    This git issue asks to modify the ask reply in the following way:

    • The recipient sends back a signature over the transaction received
    • The sender checks that the signature and store it in its local KVS. The sender will then be able to use the signature to make the recipient accountable.
    enhancement 
    opened by adecaro 0
Owner
Hyperledger Labs provides a space where work can easily be started without the creation of an official Hyperledger project.
null
Token-list - The community maintained Solana token registry

Please note: This repository is being rebuilt to accept the new volume of token

null 0 Feb 2, 2022
Quick add or delete ASN/AS-SET to your AS-SET through RIPE RESTful API

RIPE AS-SET updater Quick add or delete ASN/AS-SET to your AS-SET through RIPE RESTful API. Requirenments You need to add "auth:" attribute in mntner

null 0 Apr 19, 2022
Assume-shell - A tool to create a shell with AWS environment credentials set

assume-shell This tool will request AWS credentials for a given profile/role and

Erik Jansson 2 Feb 14, 2022
The MinIO Admin Go Client SDK provides APIs to manage MinIO services

Golang Admin Client API Reference The MinIO Admin Golang Client SDK provides APIs to manage MinIO services. This quickstart guide will show you how to

High Performance, Kubernetes Native Object Storage 29 Jun 30, 2022
A go sdk for baidu netdisk open platform 百度网盘开放平台 Go SDK

Pan Go Sdk 该代码库为百度网盘开放平台Go语言的SDK

Jsyz Chen 71 Jun 15, 2022
Nextengine-sdk-go: the NextEngine SDK for the Go programming language

NextEngine SDK for Go nextengine-sdk-go is the NextEngine SDK for the Go programming language. Getting Started Install go get github.com/takaaki-s/nex

null 0 Dec 7, 2021
Commercetools-go-sdk is fork of original commercetools-go-sdk

commercetools-go-sdk The Commercetools Go SDK is automatically generated based on the official API specifications of Commercetools. It should therefor

Flink 0 Dec 13, 2021
Sdk-go - Go version of the Synapse SDK

synapsesdk-go Synapse Protocol's Go SDK. Currently in super duper alpha, do not

null 0 Jan 7, 2022
Redash-go-sdk - An SDK for the programmatic management of Redash, in Go

Redash Go SDK An SDK for the programmatic management of Redash. The main compone

RecoLabs 24 Mar 3, 2022
Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers

go-whatsapp Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers. Big thanks to all contributors of

Relldev メイ 3 Mar 19, 2022
Is a microservice which provides payment token service for application users.

Tulip Is a microservice which provides payment token service for application users. Description A transactional-based token usually used for transacti

null 0 Feb 17, 2022
A compute service that lets you run code without provisioning or managing servers

AWS Lambda for Go Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availab

Ibrahim Dauda 0 Oct 13, 2021
Prismplus - Prism+ lets you multicast your rtmp stream to multiple destinations

prism+ Use at your own risk! It has worked for us.. but very much alpha quality!

Aaron Ogle 9 May 9, 2022
Metrics package helps to create ydb-go-sdk traces with monitoring internal state of driver

metrics metrics package helps to create ydb-go-sdk traces with monitoring internal state of driver Usage import ( "fmt" "sync/mutex" "time

YDB Platform 2 Apr 19, 2022
Go library for accessing trending repositories and developers at Github.

go-trending A package to retrieve trending repositories and developers from Github written in golang. This package were inspired by rochefort/git-tren

Andy Grunwald 120 Jun 19, 2022
An unofficial package in Golang to help developers implement ZATCA (Fatoora) QR code easily.

Zatca SDK GO An unofficial package in Golang to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing ✅ The hash

null 13 May 23, 2022
NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI).

nkn-esi NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI). An ESI supports a distributed marketplace for energy services on the electr

Elijah J. Passmore 2 Mar 18, 2022
Create a new OpenAPI based blink-plugin

OpenAPI plugin template Create a new OpenAPI based blink-plugin. READ FIRST Getting the Repo Option 1: From Github Press Use this template Naming conv

Blink 0 Oct 14, 2021
A Facebook Graph API SDK For Go.

A Facebook Graph API SDK In Golang This is a Go package that fully supports the Facebook Graph API with file upload, batch request and marketing API.

Huan Du 1.1k Jun 27, 2022