proposals icon indicating copy to clipboard operation
proposals copied to clipboard

Need token standard that mandates storage format

Open jsolman opened this issue 6 years ago • 7 comments

The NEP-5 token standard does not mandate a storage key format or expose a mandatory method to get the prefix or or format of storage keys for the contract. We need this in the token standard in order to be able to use Patricia Tree in Neo 3.0 to validate balances. Also we need it to track token balance changes more efficiently.

jsolman avatar Mar 26 '19 13:03 jsolman

Even if you specify the format of the key, the value may be a serialized struct.

erikzhang avatar Mar 26 '19 13:03 erikzhang

The value needs to be mandated also in the standard. It could support more than one type as long as the standard defines it sufficiently to it determine the balance programmatically.

jsolman avatar Mar 26 '19 19:03 jsolman

Values can be difficult to be mandated because they are business related. Even some of the contract balances are calculated, not directly stored.

erikzhang avatar Mar 27 '19 05:03 erikzhang

Then it needs to mandate a key that will exist if there is a non-zero balance for an address if the storage does not conform to the standard format. It would be acceptable if there were some false positives.

I should note though that the Patricia tree will not really help validate a balance if the balance value format is not defined in a standard way.

jsolman avatar Mar 27 '19 14:03 jsolman

Maybe it can be another NEP? Example: NEP: Verifiable Token Standard.

erikzhang avatar Mar 27 '19 14:03 erikzhang

@erikzhang Yes, I expected it will need to be an additional NEP; native NEO and GAS assets should use it.

jsolman avatar Mar 31 '19 17:03 jsolman

#151 can help with this.

roman-khimov avatar Sep 13 '22 15:09 roman-khimov