Proof Generation and Batching
As explained in the previous section, each user update to the zkDB generates a proof that verifies the validity of the change, as well as the validity of all previous updates. To optimise performance and minimise overhead, these individual proofs are batched together into a single proof, which can represent a large number of updates. In practice, we might generate a batched proof for all user updates that occur within a given time period, such as a day. This batched proof encapsulates the entire set of operations within that period, ensuring that the entire database remains valid and consistent.On-Chain Verification
Once a batched proof is generated, it is submitted to a smart contract deployed on the blockchain. This contract serves as the on-chain verifier, which checks the validity of the proof using zero-knowledge verification techniques. By posting the proof on-chain, we create a public, immutable record that attests to the correctness of all updates made during that period. The key benefits of this approach include:- Blockchain time-stamping: Each batched proof is time-stamped by the blockchain, providing an immutable, auditable history of database updates.
- Cost-efficiency: By batching proofs, we significantly reduce the computational and financial cost of verification, compared to posting each individual proof on-chain.
- Transparency and trust: The on-chain verification process allows any interested party to verify the integrity of the zkDB, without exposing sensitive user data.
Workflow Summary
- User Update: Each time a user updates their data, a proof is generated.
- Batched Proof: At regular intervals (such as daily), the system generates a single batched proof representing all updates made within that period.
- On-Chain Submission: The batched proof is posted to a smart contract on the blockchain.
- Verification: The smart contract verifies the batched proof, ensuring the validity of all updates and preserving an immutable record on-chain.