L2 Metadata Sidechain
Describes abstract solution for an L2 metadata sidechain
The obvious solution to handle metadata issues, is to remove metadata concerns into its own decentralized network that can function as a side-chain to a particular L1, or rather to multiple L1 chains, so there is cross-chain interoperability via a data protocol.
It can be done in the same way as currently images and other binaries are offloaded from an L1 to IPFS, persisting only the hash of the metadata block in L1 and let the metadata structure in L2 support the rest of the requirements for advanced metadata handling.
Lets assume L1 has a dedicated space for storing transaction or NFT metadata, and L2 supports some hierarchical structure that can describe NFT metadata as an entity and this entire structure can be hashed and the hash can stored in L1 together with an L2 ID, allowing us to quickly query all the metadata associated with this NFT, and an NFT identifier, such as token policy ID, can be stored in L2 metadata sidechain, providing a bi-directional link between the two.
Now the consistency of metadata in L2 is guaranteed by security of L1, but only until an update in L2 is made. Once an update in L2 is made, there are a few options:
- 1.Let L2 handle all its security and guarantee that data has not been tampered with.
- 2.Create a transaction with a new L2 entity hash in L1 every time an update in L2 is made.
- 3.Allow L2 updates accumulate and post a “checkpoint” transaction in L1, assuming there is a blockchain ledger structure in L2 that would guarantee metadata update history consistency between the checkpoints.
The first option will entail that L2 supports a robust consensus protocol, such as oBFT (Ouroboros Byzantine Fault Tolerant) as well as blockchain ledger structure.
Option 2 will be like a series of snapshots and L1 will keep consistent history between them.
Option 3 will only require a ledger, and, maybe, a lightweight consensus protocol, such as RAFT, assuming regular checkpoints will be taken at significant events. An example of such an event is closing on an auction, where current winning bid against NFT can be recorded in L2 and once the auction closes, a checkpoint transaction with current metadata entity hash is submitted to L1 “sealing” the current state of the NFT.