Skip to main content

Module: schnorr

The @aztec/accounts/schnorr export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption. This is the suggested account contract type for most use cases within Aztec.

Classes

Variables

SchnorrAccountContractArtifact

Const SchnorrAccountContractArtifact: ContractArtifact

Functions

getSchnorrAccount

getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt?): Promise<AccountManager>

Creates an Account Manager that relies on a Grumpkin signing key for authentication.

Parameters

NameTypeDescription
pxePXEAn PXE server instance.
secretKeyFrSecret key used to derive all the keystore keys.
signingPrivateKeyFqGrumpkin key used for signing transactions.
salt?SaltDeployment salt.

Returns

Promise<AccountManager>

An account manager initialized with the account contract and its deployment params


getSchnorrAccountContractAddress

getSchnorrAccountContractAddress(secret, salt, signingPrivateKey?): Promise<AztecAddress>

Compute the address of a schnorr account contract.

Parameters

NameTypeDescription
secretFrA seed for deriving the signing key and public keys.
saltFrThe contract address salt.
signingPrivateKey?FqA specific signing private key that's not derived from the secret.

Returns

Promise<AztecAddress>


getSchnorrWallet

getSchnorrWallet(pxe, address, signingPrivateKey): Promise<AccountWallet>

Gets a wallet for an already registered account using Schnorr signatures.

Parameters

NameTypeDescription
pxePXEAn PXE server instance.
addressAztecAddressAddress for the account.
signingPrivateKeyFqGrumpkin key used for signing transactions.

Returns

Promise<AccountWallet>

A wallet for this account that can be used to interact with a contract instance.


getSchnorrWalletWithSecretKey

getSchnorrWalletWithSecretKey(pxe, secretKey, signingPrivateKey, salt): Promise<AccountWalletWithSecretKey>

Gets a wallet for an already registered account using Schnorr signatures.

Parameters

NameTypeDescription
pxePXEAn PXE server instance.
secretKeyFrSecret key used to derive all the keystore keys.
signingPrivateKeyFqGrumpkin key used for signing transactions.
saltSaltDeployment salt.

Returns

Promise<AccountWalletWithSecretKey>

A wallet for this account that can be used to interact with a contract instance.