ZKP Implementation details
The Circom Circuit powering the application
The direct debit implementation is powered by this zkp circuit.
Let me explain what is going on, 🤔
Commitment Hasher
The hasher takes a nullifier, a secret and a nonce which are BigIntegers and outputs Poseidon Hashes Commitment and PaymentIntent
Nullifier is a random generated number created when the Debit Account is created
Secret is a random generated number created when the Debit Account is created
Nonce is a random generated number created when a payment intent is created to allow reusing the Nullifier!
The Commitment hash is the identifier of the Account. It is the poseidon hash of the nullifier and the secret
The PaymentIntent hash is the identifier of the PaymentIntent that is used to nullify it and it's created by hashing the nullifier with the nonce!
Direct Debit Template
The template contains public, private and hidden signals. The public signals need to be available when the proof is verified in the smart contract, the private signals are kept secret and the hidden signals are used to verify parameters of the subscription so they can't be altered! Private Inputs, These are provided only when the ZKP is created
Secret, nonce, nullifier
Public Inputs:
paymentIntent - Used to verify the creator knows the nullifier and the nonce without revealing it
commitment - Used to verify the creator knows the secret and the nullifier that created the commitment hash
payee, maxDebitAmount,debitTimes, debitInterval - These are arguments to the smart contract function and they are used to verify they were not tampared with, this is done using hidden signals!
Last updated