The explorer is out of sync. The last synced block is 491 hours ago. Current block height: explorer: 2206528 / node: 2520320 / ref: 2492275

Program onchain_issuer_test2.aleo

Program ID
onchain_issuer_test2.aleo
Owner signature
sign1cpg9wp3t9mf4gz8phgrcs84a5cwv573hrrw82y7laxuemtxy6vqwj5hha945g66tsy8wfqn8kfgm0qg3elgxz0q33kvy6ljf67lcqq8f7r3ha5jtug2jyj589saaesfgr207yvnx8qya6hs9k8lyptdap9detfpgjafy925s6jeh2g7k49ate9u583r8azzg598rd544qgts6ed8mc0
Times called
1
Similar programs
Imports
-
Mappings
-
Structs
Credentials
Records
SignedCredential
Functions
verify_hash
signature_verification
Transitions
issue(signature, address, field, u8, Credentials) -> (SignedCredential, boolean)
Program Source Code (Aleo Instruction) Upload Leo source

program onchain_issuer_test2.aleo;

struct Credentials:
    issuer as address;
    subject as address;
    dob as field;
    nationality as field;
    expiry as field;

record SignedCredential:
    owner as address.private;
    credential as Credentials.private;
    sig as signature.private;

closure verify_hash:
    input r0 as u8;
    input r1 as field;
    input r2 as Credentials;
    is.eq r0 0u8 into r3;
    hash.psd2 r2 into r4 as field;
    is.eq r1 r4 into r5;
    is.eq r0 1u8 into r6;
    hash.bhp1024 r2 into r7 as field;
    is.eq r1 r7 into r8;
    hash.psd2 r2 into r9 as field;
    is.eq r1 r9 into r10;
    not r3 into r11;
    and r11 r6 into r12;
    ternary r12 r8 r10 into r13;
    ternary r3 r5 r13 into r14;
    output r14 as boolean;

closure signature_verification:
    input r0 as field;
    input r1 as signature;
    input r2 as address;
    sign_verify r1 r2 r0 into r3;
    output r3 as boolean;

function issue:
    input r0 as signature.private;
    input r1 as address.private;
    input r2 as field.private;
    input r3 as u8.private;
    input r4 as Credentials.private;
    call verify_hash r3 r2 r4 into r5;
    assert.eq r5 true;
    call signature_verification r2 r0 r4.issuer into r6;
    cast r4.subject r4 r0 into r7 as SignedCredential.record;
    output r7 as SignedCredential.record;
    output r6 as boolean.private;

Block heightTimestampTransition IDFunction callState
86,2752023-10-27 16:20:25au1j0zxrsdsyxn7tshlrdc8lk9y98n5vdwexggzn8l9asr5rcmj55fqygas7aissueAccepted
Program has no mappings.
Not implemented