module arch.system.state.resource_machine.data_structures.action.resource_logic_proof;
Resource logic proof¶
Resource logic proofs attest to validity of resource logics. A resource logic is a computable predicate associated with a resource (this resource is referred to as self
in this context) 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 that action.
Instance¶
- Resource's commitment/nullifier
isConsumed
- a flag that tells the logic if the resource is consumed or createdconsumed
(excluding the tagged resource, if it is consumed)created
(excluding the tagged resource, if it is created)applicationData
Witness¶
self
resource object- If
isConsumed = True
: nullifier key ofself
- Resource objects of consumed resources:
List (Resource, NullifierKey)
- Resource objects of created resources:
List Resource
- Application-specific inputs
Note
Instance and witness elements are expected to go in the same order: the first element of the instance corresponds to the first elements of the witness and so on.
Constraints¶
- For created resources: created commitment integrity:
r.commitment() = cm
- For consumed resources:
r.nullifier(nullifierKey) = nf
- Application-specific constraints
Checks that require access to global CMTree
and NullifierSet
:
- each created resource wasn't created in prior transactions
- each consumed resource wasn't consumed in prior transactions
Note
Actions can be verified as parts of supposedly valid transactions and individually, when building a valid transaction (e.g., in the partial solving case). In case the actions are verified not individually, all global checks can be aggregated and verified at once to reduce the amount of global communication.