Skip to content

Commit 0238fef

Browse files
authored
add anoma-nullifier-key builtin (#92)
1 parent b0c1888 commit 0238fef

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

BaseLayer/ResourceMachine.juvix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ with
4444
end;
4545

4646
--- The nullifier key type describing a secret required to compute the ;Nullifier; of a resource
47+
builtin anoma-nullifier-key
4748
type NullifierKey := privateMk ByteArray
4849
with
4950
type Raw := mk AnomaAtom;
@@ -299,7 +300,7 @@ with
299300

300301
module Transparent;
301302
nullifier : Resource -> Nullifier :=
302-
NullifiableResource.Transparent.mk >> NullifiableResource.nullifier;
303+
NullifiableResource.Transparent.mk >> NullifiableResource.nullifier NullifierKey.Transparent.mk;
303304
end;
304305
end;
305306

@@ -493,13 +494,11 @@ type NullifiableResource :=
493494
resource : Resource;
494495
}
495496
with
496-
-- FIXME The computation of the nullifier should depend on the nullifier key
497-
-- TODO add NullifierKey argument
498497
builtin anoma-resource-nullifier
499-
axiom rawNullifier : Resource -> Nat;
498+
axiom rawNullifier : NullifierKey -> Resource -> Nat;
500499

501-
nullifier : NullifiableResource -> Nullifier :=
502-
resource >> rawNullifier >> Nullifier.fromNat;
500+
nullifier (nfk : NullifierKey) : NullifiableResource -> Nullifier :=
501+
resource >> rawNullifier nfk >> Nullifier.fromNat;
503502

504503
module Transparent;
505504
mk (resource : Resource) : NullifiableResource :=

juvix.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Do not edit this file manually.
33

44
version: 2
5-
checksum: 802bf5058aee28e0866ffd5c024cbbe53ebba768cc2e75e77bc2da71de1ecca1
5+
checksum: fdae04b8525adca1be7ebefbdfd1c08a8e4e855df1059cfbcae37f731c88a1d1
66
dependencies:
77
- git:
88
name: anoma_juvix-stdlib

0 commit comments

Comments
 (0)