Try โ€‚โ€‰HackMD

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

QEDIT QAT Blockchain Demo for Assioma

In this document, we present the details of the QEDIT Asset Transfer (QAT) solution as per the scope defined in the pricing proposal with reference: 20210618-QAT01.

This includes, a testing cloud environment where QAT has been deployed as a single node. The API keys to interact with the system and an example script to test the different modes of operation (issuance, transfer, etc.)

The documentation for the API is can be found here.

Access Details to QAT Demo Node

We have prepared a test environment for Assioma, hosted on AWS (Frankfurt). In order to access it, you can either call the API locally, or use the Swagger GUI by following the steps below:

Using Swagger

  1. Access the swagger QAT site: http://asset-api.qed-it.com/

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

  1. Fill the following

    • server_url : assioma-1.qed-in.com
    • port : 12052
  2. Click Authorize and add the API token authorization

    • ApiKeyAuth Value: J#5424#SCLt
    • Click Authorize and Close

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Using a CLI

In order to authorize the use of a specific API call, run the following command (the following is an example for the /node/get_all_wallets API):

curl -X POST "http://assioma-1.qed-in.com:12052/node/get_all_wallets" -H  "accept: application/json" -H  "x-auth-token: J#5424#SCLt"

Reproducing the QAT Demo to Assioma

The entire demo is available to watch at this Youtube link.

Let's go over the main steps of the demo. The outputs presented here are the state of the network as of September 5th 2021. In order to try the API calls from the Swagger GUI, click on a specific API and then

  • click on Try it out
  • input the specific parameters
  • click on Execute
  • checkout the response body for the output

Network & Wallets

The network is defined by the private and public state of the blockchain and the different nodes in the system. The governance rules (who is an admin and who can issue assets) is part of the public state:

  1. /node/get_rules
    • Input: N/A
    • Output:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "rules": [
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹        {
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "can_issue_confidentially": false,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "is_admin": true,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "namespace": "",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "public_key": "374ec93f4f43d9d5609864b1fdce7996c161938e3b0e78f5c38394d69a5dc2b9"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹        },
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹        {
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "can_issue_confidentially": true,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "is_admin": false,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "namespace": "mfg1.*",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹          "public_key": "4c27ff25a0f88388756c1d4aaf78c17e91aa3b445133078630d1366c611b28d4"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹        }
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹      ]
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      

In this demo we have a deployed a single node that can host many wallets that simulate different nodes. These are the current wallet ids in the node.

  1. /node/get_all_wallets
    • Input: N/A
    • Output:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹"wallet_ids": [
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "admin",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "mfg1",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "ship1",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "wh1",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "test1"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  ]
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      

For each wallet, one can retrieve the balance of every type of asset owned by the wallet.

  1. /wallet/get_balances
    • Input:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "wallet_id": mfg1
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      
    • Output:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "assets": [
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    {
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹      "amount": 1,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹      "asset_id": "mfg1.widget1"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    }
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  ],
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "wallet_id": "mfg1"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      

It is recommended to generate new addresses when dealing with different senders.

  1. /wallet/get_new_address
    • Input:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹    "wallet_id": mfg1
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      
    • Output:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "recipient_address": "q1frjma3tre4juu990kuq0nmc0aq8mhx2ynpwl43e72mzmy4gsyzaz56s9hu0vlss28e6pu0pkpj0",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "wallet_id": "mfg1"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      

Issuance

Only the wallets allowed to issue, can do so under the namespace assigned to them in the rule.

  1. /wallet/issue_asset
    • Input:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "wallet_id": "mfg1",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "authorization": "PrivacyIsAwesome",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "recipient_address": "q1frjma3tre4juu990kuq0nmc0aq8mhx2ynpwl43e72mzmy4gsyzaz56s9hu0vlss28e6pu0pkpj0",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "amount": 4,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "asset_id": "mfg1.token2",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "confidential": true,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "memo": "{\"recipient_name\": \"David\"}",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      
    • Output: transaction ID

Transfer

This call transfers two mfg1.token2 assets to the wallet named ship1. We require confirmation from the ship1 user by adding its wallet public key. For no confirmation, remove the last object of the input.

  1. /wallet/transfer_asset
    • Input:
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹{
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "wallet_id": "mfg1",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "authorization": "PrivacyIsAwesome",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "recipient_address": "q1adm45sct45wkz3g66r4yz4zzsddp95x7dtjqykfafenp52x5hwlg4hcynnrd7vnkatzegf0e438",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "asset_id": "mfg1.token2",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "amount": 2,
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "memo": "{\"recipient_name\": \"ship1\"}",
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹  "require_confirmation_from": "6daeeeb469d7359b0469404aa0f50dd40af26bfb5a5c7ea3b8bd680cbbfcee3c"
      โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹}
      
    • Output: transaction ID

As shown in the demo recording, the API supports further functionality such as network monitoring, billboard of attachments and documents and some auditability of wallets.

Admin wallet details

{
    "authorization": "dgfbrR4!",
    "encrypted_sk": "3673c105417b8cd6fd56d47edf6b605bfaf239d3e6e3b2d7e37c773bb860bb7131d1450296df1704d77bb790739aa18d",
    "public_key": "374ec93f4f43d9d5609864b1fdce7996c161938e3b0e78f5c38394d69a5dc2b9",
    "salt": "a744cc866ef59228c5570feda9f929c8047df56c19bbacd57ca086602ece76fa",
    "wallet_id": "admin"
}