This repository has been archived by the owner on Dec 9, 2023. It is now read-only.
RGB Node API for smart contract state #221
dr-orlovsky
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is planned to generalize RGB Node API for reading the state of RGB smart contracts, which will be (a) abstracted from a specific schema but (b) still be able to provide all information necessary for the wallets without the use of schema-specific parsing libraries (like
rust-rgb20
andrust-rgb21
).How response from the node may look like? I think about something in the form of:
Of course these data can be provided in JSON, I am using YAML here just for the higher readability.
In order to get RGB Node doing this stuff we need to introduce "RGB interface" and transform things like RGB20, 21 etc into an abstract interfaces covering multiple schema (and schema able to implement multiple interfaces). This will also simplify independent schema development.
The way interface and its implementation for a schema may look like is shown in https://github.com/orgs/RGB-WG/discussions/218, section "API exposed by contracts". These APIs will be compiled into ABI files which can be imported into the Node and used for parsing contract state.
The schemata will be specifying which ABI they support, and these data will not be a part of the consensus, but a part of the "schema package" distributed by schema devs, which, additionally to the schema consensus data will contain meta-information about the schema, including ABI, and will be signed by the schema developer. Such packages may be distributed via curated centralized registry such as https://github.com/RGB-WG/schemata or Storm; the curated registry will be more preferable to prevent hacky schema distribution on the initial stages until users will be well-aware about which schema developers they should trust by using WoT-like identities.
Schema interface (ABI files) will map schema-specific type ids to a standard types defined by a schema interface standard (such as RGB20):
Beta Was this translation helpful? Give feedback.
All reactions