ntls-io / nautilus-trusted-compute

Nautilus Trusted Compute
GNU Affero General Public License v3.0
0 stars 3 forks source link

feat(asset-manager): create asset manager library #19

Open jdvlio opened 2 years ago

jdvlio commented 2 years ago

Overview

A library for managing assets on the Algorand blockchain. This PR is intended to partially address issue #13

Task breakdown

Todo

Implementation

DRT encoding

DRTs are encoded as JSON objects in the note field of the initial asset configuration transaction that instantiated them as a new ASA on the Algorand blockchain. The structure of this object is outlined in the following table:

Field name Type Description
binary ~byte array~ base64 A cryptographic hash of the binary WASM executable.
binary_url string A URL pointing to the WASM binary.
data_package ~byte array~ base64 A cryptographic hash of the data package referenced by this DRT.
data_url string A URL pointing to the relevant data package.

Public API

A DrtConfig struct facilitates the creation of new DRTs on the Algorand blockchain. This struct is obtained via a DrtConfigBuilder struct by calling the build method. New DRTs are deployed as Algorand Standard Assets upon calling the asynchronous deploy method on the DrtConfig struct.

billguo99 commented 2 years ago

Tested with my "Bert" algorand account and successfully created DRT through the integration test by supplying mnemonic in .env:

  1. https://testnet.algoexplorer.io/address/FX4RARS3PGUDGXF2OUTKUMTRTOWI3277UGIKINH4KREGHJTHMJFRYBIP2E
  2. https://testnet.algoexplorer.io/asset/96492563