Anoma.Node.Transaction.Backends (Anoma v0.29.0)
I am the Transaction Backend module.
I define a set of backends for the execution of the given transaction candidate. Currently, I support transparent resource machine (RM) execution as well as the following debug executions: read-only, key-value store, and blob store executions.
Public API
I have the following public functionality:
Summary
Functions
I am the commitment accumulator add function for the transparent resource machine.
I execute the specified transaction candidate using the designated backend.
If the transaction is provided as a jam
med noun atom, I first attempt
to apply cue/1
in order to unpack the transaction code.
I am the commitment accumulator value function for the transparent resource machine.
I am the commitment accumulator verify function for the transparent resource machine.
I am the commitment accumulator witness function for the transparent resource machine.
Types
backend()
@type backend() :: :debug_term_storage | {:debug_read_term, pid()} | :debug_bloblike | :transparent_resource
transaction()
Functions
add(acc, cm)
I am the commitment accumulator add function for the transparent resource machine.
Given the commitment set, I add a commitment to it.
blob_store(node_id, id, result)
execute(node_id, arg, id)
@spec execute(node_id, {back, Noun.t()}, id) :: :ok when id: binary(), node_id: String.t(), back: backend()
I execute the specified transaction candidate using the designated backend.
If the transaction is provided as a jam
med noun atom, I first attempt
to apply cue/1
in order to unpack the transaction code.
First, I execute the transaction code on the Anoma VM. Next, I apply processing logic to the resulting value, dependent on the selected backend.
- For read-only backend, the value is transmitted as a Result Event.
- For the key-value and blob store executions, the obtained value is stored and a Complete Event is issued.
- For the transparent Resource Machine (RM) execution, I verify the transaction's validity and compute the corresponding set of nullifiers, which is transmitted as a Nullifier Event.
store_value(node_id, id, result)
value(acc)
I am the commitment accumulator value function for the transparent resource machine.
Given the commitment set, I turn it to binary and then hash it using sha-256.
verify(cm, w, val)
I am the commitment accumulator verify function for the transparent resource machine.
Given the commitment, a witness (i.e. a set) and a commitment value, I output true iff the witness's value is the same as the provided value and the commitment is indeed in the set.
witness(acc, cm)
I am the commitment accumulator witness function for the transparent resource machine.
Given the commitment set and a commitment, I return the original set if the commitment is a member of the former. Otherwise, I return nil