How will Hivemind handle NAIs when SMTs come out?

in Hivemind5 years ago

I was studying utils.normalize.parse_amount() and saw that it handles NAI inputs but checks them against a CONSTANT that currently hosts mappings to STEEM, SBD and VESTS NAIs.

Will there be changes to how token symbols are stored in the DB? Currently, it's the actual symbol that's stored. Will this change to NAIs? Or will there be a common registry that Hivemind will pull from in the future?

Sort:  

There's mention of a directory for NAIs in the whitepaper, but I'm not aware of implementation, yet:

https://github.com/steemit/smt-whitepaper/blob/master/smt-manual/manual.md#numerical-asset-identifiers

Thanks @inertia. I gave it a read and it makes more sense now :)

What made me ask this is that Native Ads will allow a community to set what token it accepts for ad payments. I'm thinking of storing that primarily as NAIs and then have the current Hivemind logic translate that to symbols for UIs when:

  1. it scans blocks for payments
  2. it parses bids

This means payments can be verified to be of the correct NAI at a blockchain level (NAI found in transactions versus the NAI setting for that community)

parse_amount will need to handle arbitrary NAIs. I'm not sure yet about name mapping, but mapping a community to an NAI could simply be done by adding a new community property.

Cool :)