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

Program onchain_issuer_test1.aleo

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

program onchain_issuer_test1.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.public;
    input r1 as address.public;
    input r2 as field.public;
    input r3 as u8.public;
    input r4 as Credentials.public;
    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
85,9592023-10-27 15:55:56au1qe7kt7fk0d2gj4h6sszvwsvncxavjqejffhudqt27a8alur84yzs09pppvissueAccepted
Program has no mappings.
Not implemented