Juvix imports
module arch.system.types.commitment;
import prelude open;
import arch.node.types.crypto open;
Commitment¶
Purpose¶
Commitments prove the existence of a value without revealing it. In the resource machine, they prove the existence of resources. Commitments are stored in the resource machine's state within a commitment tree for querying.
Commitment
¶
type Commitment A :=
mkCommitment@{
committed : A;
commitment : Digest;
};
Arguments
committed
- The value that is committed to.
commitment
- The hash of the value.
Auxiliary Juvix code: Instances
deriving instance
CommitmentEq {A} {{Eq A}} : Eq (Commitment A);
deriving instance
CommitmentOrd {A} {{Ord A}} : Ord (Commitment A);
makeCommitment
¶
makeCommitment {A} (a : A) : Commitment A :=
mkCommitment@{
committed := a;
commitment := hash a;
};
Properties¶
Todo
Add properties of the commitment.