Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Atomic Metadata #1
This PR serves to prototype the ability to publish and interpret atomic metadata via the Omni Layer.
The purpose is to remove duplication of metadata in future transaction types that may permit attaching metadata. For example the string "This transaction means X, find out more at Y.com" could be included with transactions relating to X but this is incredibly inefficient. Instead the string could be published just once and then referenced.
"Atomic metadata" in this context is metadata which is independent of any transaction and even independent of the Omni state. To put it another way, it is not consensus-affecting. Publishing metadata on-chain is a contentious issue, and the methodology used is intended to provide the functionality as an extension outside of the consensus state all clients must share.
The outline is fairly straight forward. Any arbitrary string (assume max length of
Since this process is isolated from the state, any future transaction can reference metadata but it cannot require it. References to non-existent metadata will simply return an empty string. Clients can choose to offer users the choice on whether to use and display metadata, and clients can even ignore metadata completely during processing without affecting the Omni state.
We can get the
We see the
Let's say we wish to publish this string on-chain so we can reference it in future transactions. We would do that with
The metadata is now available to be referenced by a future transaction. We can retrieve the metadata by passing the address and the
If we inspect the transaction we will see it is of a new type (
It may also prove useful to obtain all the metadata a given address has published, and this can be done with the