//! Programs generated by pinned Neptune consensus0.15.1, revision
//! 9869b5e35b659dc520fad51ba5a9c812fed46db0, on Triton7/native proof5.
//! Reproduce with tools/neptune-policy-oracle; these are owner constants,
//! never supplied by the proof witness. SingleProof uses HardforkGamma policy.
use triton_vm::prelude::*;

pub const NATIVE_PROOF_VERSION: u32 = 5;
pub const TRANSACTION_ENTRYPOINT: &str = "trisha_neptune_transaction_verify_v1";
pub const NATIVE_CURRENCY_ENTRYPOINT: &str = "trisha_neptune_native_currency_verify_v1";
pub const SINGLE_PROOF_PROGRAM: [u64; 5] = [
    17162881904615831636,
    12772901116553038606,
    7422951533421993946,
    14441376456998198752,
    13597937147074334762,
];
pub const NATIVE_CURRENCY_PROGRAM: [u64; 5] = [
    11305007904490302261,
    9599338968880624023,
    13137634647446694715,
    16075658688778637089,
    7210249028992940817,
];

pub fn transaction_claim(kernel: Digest) -> Claim {
    super::expected_claim(
        Digest::new(SINGLE_PROOF_PROGRAM.map(BFieldElement::new)),
        &[kernel],
    )
}

pub fn native_currency_claim(kernel: Digest, inputs: Digest, outputs: Digest) -> Claim {
    super::expected_claim(
        Digest::new(NATIVE_CURRENCY_PROGRAM.map(BFieldElement::new)),
        &[kernel, inputs, outputs],
    )
}

pub fn protocol_assembly(entrypoint: &str) -> Option<String> {
    assert_eq!(
        triton_vm::proof::CURRENT_VERSION,
        NATIVE_PROOF_VERSION,
        "pinned Neptune programs require reviewed native-version migration"
    );
    let (program, count) = match entrypoint {
        TRANSACTION_ENTRYPOINT => (SINGLE_PROOF_PROGRAM, 1),
        NATIVE_CURRENCY_ENTRYPOINT => (NATIVE_CURRENCY_PROGRAM, 3),
        _ => return None,
    };
    Some(super::fixed_claim_assembly(
        entrypoint,
        Digest::new(program.map(BFieldElement::new)),
        count,
    ))
}

Homonyms

warriors/trisha/cli/neptune.rs

Graph