To further enhance the security and simplicity of our zkDB, we utilize an on-chain verifier that allows for the validation of batched proofs on the blockchain. This system ensures that all updates to the database are provably correct, and that the integrity of the entire system can be independently verified in a very quick manner.

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

  1. User Update: Each time a user updates their data, a proof is generated.
  2. Batched Proof: At regular intervals (such as daily), the system generates a single batched proof representing all updates made within that period.
  3. On-Chain Submission: The batched proof is posted to a smart contract on the blockchain.
  4. Verification: The smart contract verifies the batched proof, ensuring the validity of all updates and preserving an immutable record on-chain.

This on-chain verifier adds an extra layer of security and trust, ensuring that the zkDB remains transparent, auditable, and resilient against tampering.