TLDR
Minting a large number of documents on Blockchain is achievable with the help of off-chain commitment and proof preparations.
The transaction costs of the protocol are low, especially when using L2 Blockchain solutions.
Core Research Question
Can a large volume of documents be minted on-chain in real-time, with the support of off-chain computations?
Citation
Aleksandar Veljković, 3327, Minty - Massive off-chain minting with verifiable on-chain commitments
Background
- Merkle tree - Data structure where the values of nodes (except leaf nodes) are determined as hashes of the values in their children nodes.
- Commitment - Value to which all future computations are bound
- Blockchain transaction - Transaction upon which the sent data is written on the blockchain
Summary
- Storing large documents on Blockchain is practically impossible.
- Real-time execution of Blockchain transactions is not guaranteed.
- Costs of writing only commitments of individual files in individual transactions or batches can skyrocket the costs when dealing with thousands of files.
- Signing thousands of individual commitments can be inefficient when the documents come frequently and in large volumes.
- Merkle tree root hash can represent a commitment of multiple files.
- Proof of knowledge for any leaf of a Merkle tree can be derived from the tree and verified in the smart contract.
- An exponential time complexity for generating Merkle trees can also be a limiting factor when dealing with tens of thousands of documents.
Method
- Parallelization of Merkle tree construction can be achieved efficiently on multicore processors.
- Multiple Merkle trees can be joined into one single tree by generating a “cap” tree where the leaves of the new tree are roots of individual subtrees.
- Commitments of documents can be generated as a root hash of a document Merkle tree constructed in a parallel manner and submitted on Blockchain in semi-real-time.
- Documents can represent any digital document or token (NFTs, for example).
- Document issuers can generate tree leaves as hashes of documents and addresses of the associated owners and construct Merkle tree in parallel.
- For each document, issuers derive Merkle proofs and send them to the owners off-chain, while the Merkle tree roots are written on-chain as commitments.
- A document owner can provide data to the smart contract and Merkle proof to mint the document on-chain.
Results
- The proposed protocol can construct root hash commitments and proofs of more than 1,000,000 individual documents in less than 1 minute on a quad-core CPU.
- Compared to signing individual documents, parallel Merkle tree generation and proof extraction efficiency achieve better results.
Discussion and Key Takeaways
- Minting a large number of documents on Blockchain is achievable with the help of off-chain commitment and proof preparations.
- The transaction costs of the protocol are low, especially when using L2 Blockchain solutions.
- The protocol is named Minty.
Implications and Follow-ups
- The proposed tree generation method could be further improved to run parallel tree generation using multiple processors or a cluster of computation servers.
- Further work will be oriented toward implementing practical solutions that utilize the Minty protocol.
Applicability
- Minting a large number of documents on- and off-chain represents a primitive that could be applied in many new use cases.
- The presented protocol can be utilized for creating NFT markets with massive off-chain minting.
- The protocol can also be applied for minting large volumes of credentials, like ID cards, passports, licenses, etc.