a ZKP library to prove a chain of any given relationship, block chain, signature chain, etc. The relationship is defined by application developers, while this library focuses on how we can prove the entire relationship chain with only one proof. This library comes with an easy to understand example.
Under the hood, we have defined two roles:
- Units, the circuit that application developers should implement to constraint the relationship to be proved;
- Recursive, the rolling proof to attestate the chain structure from
Genesis
to the latest in the chain.
We have upgraded chainark to allow Units to have multiple implementations, providing a more compact proving system. In the attached example, we may have the unit to prove 1
relationship (nextId = hash(currentId)
), or 2
(nextNextId = hash(hash(currentId))
), etc.
Further, chainark also allows to have multiple implementation for Recursive circuits. A typical example is to have the recursive circuit directly (non-recursive) verify some relationship to further extend the link, resulting in the HybridCircuit
. This has been added to the attached example as well.
When all the unit circuits and the recursive ciruit (but not the hybrid cricuits) have sizes in the same 2's-power range (for this version, (true
to the chainark.NewRecursiveCircuit
function all. This optimization may reduce over 3 million constraints but the prerequisite might not hold in a future version of chainark.