Problem
The KnownMagic enum in crates/cli/src/meta/magic.rs does not include the OffchainAsset (OA) magic numbers used by the ethgild/SFT tokenization ecosystem for encoding receipt information in OffchainAssetReceiptVault deposits and withdrawals.
These magic numbers are already in use by the gildlab/SFT frontend and the h20.market tokenization UI, but they are not part of the rain-metadata crate, making it impossible to use RainMetaDocumentV1Item for encoding/decoding receipt information.
Missing magic numbers
| Number |
Name |
Purpose |
0xffa8e8a9b9cf4a31 |
OA_SCHEMA |
Schema reference for offchain asset data |
0xff9fae3cc645f463 |
OA_HASH_LIST |
IPFS hash list for offchain assets |
0xffc47a6299e8a911 |
OA_STRUCTURE |
Structured offchain asset data (e.g., receipt information) |
0xff8cd2927c8c86cb |
OA_TOKEN_IMAGE |
Token image metadata |
0xffbc38eb14ad2209 |
OA_TOKEN_CREDENTIAL_LINKS |
Token credential links |
Additional consideration
The SFT frontend also uses OA_SCHEMA as an additional CBOR map key (beyond the standard 0-4 keys) to embed schema references within a CBOR map item. The current RainMetaDocumentV1Item struct only supports keys 0-4. Supporting this extension would require either:
- Adding an optional
schema field to RainMetaDocumentV1Item
- Or a more general mechanism for custom map keys
Context
We are building an issuance bot that interacts with Rain OffchainAssetReceiptVault contracts and need to encode receipt information in the Rain metadata v1 format. Without these magic numbers in the crate, we cannot use the official rain-metadata library and must reimplement the CBOR encoding ourselves.
Related spec PR: rainlanguage/specs#48
Problem
The
KnownMagicenum incrates/cli/src/meta/magic.rsdoes not include the OffchainAsset (OA) magic numbers used by the ethgild/SFT tokenization ecosystem for encoding receipt information inOffchainAssetReceiptVaultdeposits and withdrawals.These magic numbers are already in use by the gildlab/SFT frontend and the h20.market tokenization UI, but they are not part of the
rain-metadatacrate, making it impossible to useRainMetaDocumentV1Itemfor encoding/decoding receipt information.Missing magic numbers
0xffa8e8a9b9cf4a31OA_SCHEMA0xff9fae3cc645f463OA_HASH_LIST0xffc47a6299e8a911OA_STRUCTURE0xff8cd2927c8c86cbOA_TOKEN_IMAGE0xffbc38eb14ad2209OA_TOKEN_CREDENTIAL_LINKSAdditional consideration
The SFT frontend also uses
OA_SCHEMAas an additional CBOR map key (beyond the standard 0-4 keys) to embed schema references within a CBOR map item. The currentRainMetaDocumentV1Itemstruct only supports keys 0-4. Supporting this extension would require either:schemafield toRainMetaDocumentV1ItemContext
We are building an issuance bot that interacts with Rain
OffchainAssetReceiptVaultcontracts and need to encode receipt information in the Rain metadata v1 format. Without these magic numbers in the crate, we cannot use the officialrain-metadatalibrary and must reimplement the CBOR encoding ourselves.Related spec PR: rainlanguage/specs#48