Anoma.RM.Transparent.Resource (Anoma v0.34.0)

I am the Resource module of the TRM.

I provide the interface to interact and create resources for the transparent resource machine.

Public API

I provide the following public functionality

Summary

Functions

I am the commitment hash function for the TRM Resource.

I am the delta function of a transparent resource.

I am the kind computation function for a transparent resource.

I am the nullifier hash function for the TRM Resource.

Types

t()

@type t() :: %Anoma.RM.Transparent.Resource{
  isephemeral: boolean(),
  labelref: integer(),
  logicref: integer(),
  nonce: <<_::256>>,
  nullifierkeycommitment: Anoma.Crypto.Sign.public(),
  quantity: integer(),
  randseed: <<_::0>>,
  valueref: integer()
}

Functions

commitment_hash(resource)

@spec commitment_hash(t()) :: integer()

I am the commitment hash function for the TRM Resource.

Given a resource, I turn it to a noun, jam it, and append the "CM_" tag onto it, afterwards turning to an integer.

commits?(self, commitment)

@spec commits?(t(), Noun.noun_atom()) :: boolean()

delta(resource)

@spec delta(t()) :: integer()

I am the delta function of a transparent resource.

I simply compute the kind of a resource, put it as a key with the value being the resource's quantity. Then I hash the preimage.

from_noun(list)

@spec from_noun(Noun.t()) :: :error | {:ok, t()}

kind(resource)

@spec kind(t()) :: <<_::256>>

I am the kind computation function for a transparent resource.

I put the label and the logic in a cell, jam it and then hash it with a sha256.

nullifier_hash(nullifier_key, resource)

@spec nullifier_hash(<<_::256>>, t()) :: integer()

I am the nullifier hash function for the TRM Resource.

Given a resource, I turn it to a noun, jam it, and append the "NF_" tag onto it, afterwards turning to an integer.

nullifies?(self, nullifier)

@spec nullifies?(t(), Noun.noun_atom()) :: boolean()