Hierarchy

  • Account

Constructors

  • Parameters

    • __namedParameters: {
          aesSecret?: Uint8Array;
          burner?: Boolean;
          eddsa?: any;
          encryptionPrivateKey?: Uint8Array;
          encryptionPublicKey?: Uint8Array;
          poseidon?: any;
          poseidonEddsaPrivateKey?: Uint8Array;
          privateKey?: BN;
          publicKey?: BN;
          seed?: string;
      }
      • Optional aesSecret?: Uint8Array
      • Optional burner?: Boolean
      • Optional eddsa?: any
      • Optional encryptionPrivateKey?: Uint8Array
      • Optional encryptionPublicKey?: Uint8Array
      • Optional poseidon?: any
      • Optional poseidonEddsaPrivateKey?: Uint8Array
      • Optional privateKey?: BN
      • Optional publicKey?: BN
      • Optional seed?: string

    Returns Account

Properties

aesSecret?: Uint8Array
burnerSeed: Uint8Array
eddsa: any
encryptionKeypair: BoxKeyPair
poseidonEddsaKeypair?: {
    privateKey: Uint8Array;
    publicKey?: [Uint8Array, Uint8Array];
}

Type declaration

  • privateKey: Uint8Array
  • Optional publicKey?: [Uint8Array, Uint8Array]
privkey: BN

Initialize a new shielded account. Generates a random private key if not defined

Param

Param

pubkey: BN

Methods

  • Parameters

    • ciphertext: Uint8Array
    • Optional nonce: Uint8Array
    • Optional signerpublicKey: Uint8Array

    Returns null | Uint8Array

  • Description

    gets domain separated aes secret to execlude the possibility of nonce reuse

    Note

    we derive an aes key for every utxo of every merkle tree

    Parameters

    • merkleTreePdaPublicKey: PublicKey
    • index: number

      the xth transaction for the respective merkle tree

    Returns Uint8Array

    the blake2b hash of the aesSecret + merkleTreePdaPublicKey.toBase58() + index.toString()

  • Parameters

    • domain: string

    Returns Uint8Array

  • Parameters

    • Optional eddsa: any

    Returns Promise<[Uint8Array, Uint8Array]>

  • Returns {
        aesSecret: string;
        encryptionPrivateKey: string;
        privateKey: string;
    }

    • aesSecret: string
    • encryptionPrivateKey: string
    • privateKey: string
  • Sign a message using keypair private key

    Parameters

    • poseidon: any
    • commitment: any

      a hex string with commitment

    • merklePath: any

      a hex string with merkle path

    Returns any

    a hex string with signature

  • Parameters

    • msg: string | Uint8Array
    • Optional eddsa: any

    Returns Promise<Uint8Array>

  • Parameters

    • aesSecret: Uint8Array
    • encryptedBytes: Uint8Array

    Returns Promise<any>

  • Parameters

    • aesSecret: Uint8Array
    • message: Uint8Array
    • iv: Uint8Array

    Returns Promise<Uint8Array>

  • Parameters

    • publicKey: Uint8Array
    • message: Uint8Array
    • signerSecretKey: Uint8Array
    • Optional nonce: Uint8Array
    • Optional returnWithoutNonce: boolean

    Returns Uint8Array

  • Parameters

    • poseidon: any
    • privateKey: string
    • encryptionPrivateKey: string
    • aesSecret: string

    Returns Account

  • Parameters

    • seed: String
    • Optional domain: string

    Returns Uint8Array

  • Parameters

    • seed: String
    • poseidon: any

    Returns BN

  • Parameters

    • privateKey: BN
    • poseidon: any

    Returns BN

  • Parameters

    • seed: string

    Returns {
        privateKey: any;
        publicKey: undefined;
    }

    • privateKey: any
    • publicKey: undefined
  • Parameters

    • seed: String

    Returns BoxKeyPair

Generated using TypeDoc