Host-side prover for the GenericCall resource logic in the
Generic Call Resource
application.
This crate wraps generic_call_witness in a
GenericCallLogic type that implements anoma-rm-risc0's LogicProver, and
embeds the compiled RISC0 guest ELF and its image ID so transactions can
generate resource-logic proofs.
GenericCallLogic— wraps aGenericCallWitnessand implementsLogicProver(exposing the guest ELF as the proving key and the image ID as the verifying key).GenericCallLogic::consumed_ephemeral_resource_logic— build the logic for a consumed ephemeral resource (requires a nullifier key).GenericCallLogic::created_ephemeral_resource_logic— build the logic for a created (balancing) ephemeral resource.GENERIC_CALL_ELF/GENERIC_CALL_ID— the embedded guest binary and its image ID.- Re-exports
GenericCallfromgeneric_call_witnessfor convenience.
use generic_call_library::{GenericCall, GenericCallLogic};
let logic = GenericCallLogic::consumed_ephemeral_resource_logic(
resource,
action_tree_root,
nf_key,
forwarder_addr,
vec![GenericCall {
to: target_addr.to_vec(),
value: 0,
data: calldata,
}],
);
// `logic` implements `LogicProver` and can be used to generate a proof.The embedded ELF (elf/generic-call-guest.bin) and GENERIC_CALL_ID come from
building generic_call_circuit with the RISC0
toolchain. After changing the witness or circuit, rebuild the guest, copy the
output ELF into elf/, and update GENERIC_CALL_ID in
src/lib.rs with the printed image ID.
GPL-3.0