Dynamically On-boarding New Assets — Factomize

  1. Find at least two APIs that provide free and reliable* data for the market price
  2. Create a polling adapter that is able to read the API endpoint and transform the data to use in pegnetd
  3. Add a new OPR version that indicates the addition of a new asset, updating the OPR and Grading package
  4. Determine an activation height for this change
  5. Implement the activation height change in both pegnetd and the reference miner
  6. Deploy the new code and work with exchanges, mining pools, and discord to coordinate the hard fork

The Two Components

  1. Dynamic API: The ability for a miner to mine a new asset and submit it
  2. Dynamic OPR: Deciding when an asset is active and required for submissions to be valid

First System: Dynamic API

Descriptor Files

  • Protocol: The method of connecting, which likely will be just HTTP(S)
  • URL / Endpoint: The address to contact in a format specific to the protocol
  • Authentication Scheme: Can be “none” or a variety of pre-configured methods like www-authentication or OAuth
  • Response format: JSON, XML, CSV, etc.
  • API-DF: The entry hash of an API-DF
  • Assets: A list of assets that this API can read, i.e. PEG & EUR
  • Paths: Each asset would have its own path for both price and the time it was updated, which depends on the format. For CSV this could be expressed as a (row, column) tuple, whereas JSON could be a list of nested keys
  • Data type: How the asset price is encoded, i.e. float vs integer

Descriptor File Examples

{ "version": 1, "protocol": "HTTP", "endpoint": "https://pegnetmarketcap.com/api/asset/all?columns=ticker_symbol,exchange_price,exchange_price_dateline", "authentication": "none", "response": "json" }
{ "api-df": "abcdef...", "assets": ["PEG"], "path": { "PEG": { "price": "root/10/exchange_price", "price_type": "float64", "time": "root/10/exchange_price_dateline", "time_format": "unix_integer" } } }
{ "version": 1, "protocol": "HTTP", "protocol_options": { "header": { "X-CMC_PRO_API_KEY":"%s", "Accepts": "application/json" }, "GET": [ {"type": "commalist", "key": "id", "value": "ids"}, {"type": "raw", "key": "convert", "value": "USD"} ] }, "endpoint": "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest", "authentication": "header:X-CMC_PRO_API_KEY", "response": "json" }
{ "api-df": "abcdef...", "assets": ["XBT", "FCT"], "protocol_options": {"ids": ["1","1807"]}, "path": { "XBT": { "price": "root/data/1/quote/USD/price", "price_type": "float64", "time": "root/data/1/quote/USD/last_updated", "time_format": "ISO-8601" }, "FCT": { "price": "root/data/1807/quote/USD/price", "price_type": "float64", "time": "root/data/1807/quote/USD/last_updated", "time_format": "ISO-8601" } } }
{ "api-df": "abcdef...", "assets": ["ETH"], "protocol_options": {"ids": ["1027"]}, "path": { "ETH": { "price": "root/data/1027/quote/USD/price", "price_type": "float64", "time": "root/data/1027/quote/USD/last_updated", "time_format": "ISO-8601" } } }

Using a Descriptor File


Centralized Marketplace

Decentralized Marketplace

Second System: Dynamic OPR


Data Structure

syntax = "proto3"; package opr; message DynamicAssetOPR { string Address = 1; string ID = 2; int32 Height = 3; repeated bytes Winners = 4; repeated uint64 Assets = 5; repeated Vote Votes = 6; } message Vote { string Asset = 1; enum Action { ADD = 0; REMOVE = 1; } }

API Requirements

Removing Assets (Optional)

Final Thoughts





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

KuChain Weekly Report #29

Updating Smart Contract Data in Unity

Architecting London’s Premier HealthTech at Home Provider: Part I

Available project . . . #heron #womantattoo #tattooist #blackworktattoo #dotwork…

InsureDAO InsureDAO is a peer to pool insurance market protocol on Ethereum.

Stop using Alpine Docker images

Custom Domains for Heroku Apps

Email Forwarding with a Timer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store



More from Medium

Cryptonovae Development Update

Is Celsius Network Safe? The Truth May Surprise You…

GCS Utility Token The Shariah-Compliant Token

Introducing: Crypto Cocks