Utxos are objects used to represent ownership of value within a VAnchor instance. The input Utxos to a VAnchor transaction represent the spending a previously created Utxo.

  • Therefore, input Utxos should have a privkey configured on the given Utxo's keypair. The output Utxos to a VAnchor transaction represent the creation of new Utxos.
  • Therefore, output Utxos don't need to have a privkey configured on the given Utxo's keypair.

Hierarchy

Constructors

Properties

_amount: string = ''
_backend: Backend = 'Circom'
_blinding: string = ''
_chainId: string = ''
_curve: Curve = 'Bn254'
_index?: number
_originChainId?: string
_pubkey: string = ''
_secret_key: string = ''
inner: JsUtxo
keypair: Keypair = ...
originChainId: undefined | string

Accessors

  • get nullifier(): string
  • Returns

    the nullifier: hash of [commitment, index, signature] as decimal string where signature = hash([secret key, commitment, index])

    Returns string

  • get public_key(): string
  • Returns

    the public key used for generating the commitment. If the utxo is configured with a secret_key, this value should be poseidonHash(secret_key)

    Returns string

  • get wasm(): Promise<{
        ExtData: any;
        JsLeaf: any;
        JsNote: any;
        JsNoteBuilder: any;
        JsProofInput: any;
        JsProofInputBuilder: any;
        JsProofOutput: any;
        JsProvingKeys: any;
        JsUtxo: any;
        LeavesMapInput: any;
        MTBn254X5: any;
        MixerProof: any;
        OperationError: any;
        VAnchorProof: any;
        default: any;
        generate_proof_js: any;
        js_note_of_jsval: any;
        js_utxo_of_jsval: any;
        main: any;
        setupKeys: any;
        verify_js_proof: any;
    }>
  • Returns Promise<{
        ExtData: any;
        JsLeaf: any;
        JsNote: any;
        JsNoteBuilder: any;
        JsProofInput: any;
        JsProofInputBuilder: any;
        JsProofOutput: any;
        JsProvingKeys: any;
        JsUtxo: any;
        LeavesMapInput: any;
        MTBn254X5: any;
        MixerProof: any;
        OperationError: any;
        VAnchorProof: any;
        default: any;
        generate_proof_js: any;
        js_note_of_jsval: any;
        js_utxo_of_jsval: any;
        main: any;
        setupKeys: any;
        verify_js_proof: any;
    }>

Methods

  • Encrypt UTXO data using the current keypair. This is used in the externalDataHash calculations so the funds for this deposit can only be spent by the owner of this.keypair.

    Returns

    0x-prefixed hex string with data

    Returns string

  • Returns

    The CircomUtxo object implementation of a Utxo.

    Parameters

    • utxoString: string

      A string representation of the parts that make up a utxo.

      • All values are represented as BigEndian, hex-encoded strings unless indicated otherwise.
      • Optional values are represented as the empty string if not present, meaning the split call will always be an array of length "parts".

      parts[0] - Curve value, e.g. Bn254, Bls381, Ed25519, etc. value represented as string. parts[1] - Backend value, e.g. arkworks or circom. value represented as string. parts[2] - Amount of atomic units, e.g. ETH in wei amounts or DOT in 10^12 decimals. value represented as uint. parts[3] - TypedChainId, the hex value of the calculated typed chain id parts[4] - Blinding, secret random value parts[5] - PublicKey, the "publicKey = hash(privateKey)" value which indicates ownership for a utxo. parts[6] Optional - EncryptionKey, the public key of "publicKey = encryptionScheme(privateKey)" value used for messaging. parts[7] Optional - PrivateKey, the secret key component correlated to the above values. parts[8] Optional - Index, the leaf index if the utxo has been inserted in a merkle tree

    Returns Promise<Utxo>

Generated using TypeDoc