Sigil documentation
ReferenceRust referencearise-sigil

arise-sigil · receipt

Source declarations, signatures and documentation for receipt.

Source: sigil/node/../arise-bridge/arise-sigil/src/receipt.rs. SHA-256: 903ce5f1b151c7a017d192ad4417d275471639ad9a2c7287edcc824937c953cc.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

receipt::ComputeReceipt

A compute receipt recording the execution of a single job.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ComputeReceipt {
/// Unique receipt identifier.

pub receipt_id: String,
/// The job this receipt corresponds to.

pub job_id: String,
/// DID of the provider that executed the job.

pub provider_did: String,
/// DID of the consumer that requested the job.

pub consumer_did: String,
/// Model identifier used for inference.

pub model_id: String,
/// Number of input tokens processed.

pub tokens_in: u64,
/// Number of output tokens generated.

pub tokens_out: u64,
/// GPU-seconds consumed.

pub gpu_seconds: f64,
/// Total cost in micro-MINT.

pub total_cost: u64,
/// ISO 8601 timestamp when execution started.

pub started_at: String,
/// ISO 8601 timestamp when execution completed.

pub completed_at: String,
/// BLAKE3 hash of the input payload.

pub input_hash: SigilHash,
/// BLAKE3 hash of the output payload.

pub output_hash: SigilHash,
/// BLAKE3 hash of the entire receipt (excluding this field).

pub receipt_hash: SigilHash,
/// Ed25519 signature from the provider over `receipt_hash`.

pub provider_signature: Vec<u8>
}

Source line: 16.

receipt::ComputeReceipt::compute_cost

Computes the total cost for a job given a pricing model and resource consumption.

The cost is the maximum of the computed usage cost and the provider's minimum job cost.

pub fn compute_cost(
        pricing: &ComputePricing,
        tokens_in: u64,
        tokens_out: u64,
        gpu_seconds: f64,
    ) -> u64;

Source line: 55.

receipt::ComputeReceipt::compute_receipt_hash

Computes the BLAKE3 hash of the receipt's content fields.

All fields except receipt_hash and provider_signature contribute to the hash.

pub fn compute_receipt_hash(&self) -> SigilHash;

Source line: 76.

receipt::ComputeReceipt::verify_hash

Verifies that the stored receipt_hash matches the computed hash.

pub fn verify_hash(&self) -> Result<(), AriseError>;

Source line: 95.

receipt::ComputeReceipt::verify_provider_signature

Verifies the provider's Ed25519 signature over the stored receipt hash.

pub fn verify_provider_signature(
        &self,
        provider_public_key: &[u8; 32],
    ) -> Result<(), AriseError>;

Source line: 107.

On this page