Resource logic proof¶
Resource logic proofs attest to validity of resource logics. A resource logic is a computable predicate associated with a resource that constrains the creation and consumption of a resource. Each time a resource is created or consumed, the corresponding resource logic proof is required in order for the action (and thus the transaction) to be valid.
Proving¶
When proving, resource logics take as input resources created and consumed in the action:
Instance¶
- Resource tag — identifies the current resource being checked
isConsumed
- a flag that tells the logic if the resource is consumed or createdaction.consumed
(possibly excluding the tagged resource, if it is consumed)action.created
(possibly excluding the tagged resource, if it is created)action.applicationData[tag]
Witness¶
-
for consumed resources:
OrderedSet (Resource, NullifierKey)
-
for created resources:
OrderedSet Resource
-
Application inputs
Note
The instance and witness values are expected to correspond to each other: the first tag in the instance corresponds to the first resource object in the witness (and corresponds to the resource being checked), and so on. Note that the tag has to be recomputed from the object to verify that it indeed corresponds to the tag (this condition is included in the constraints)
Constraints¶
- Created commitment integrity:
r.commitment() = cm
- Consumed nullifier integrity:
r.nullifier(nullifierKey) = nf
- Application constraints