Socket
Socket
Sign inDemoInstall

@aztec/accounts

Package Overview
Dependencies
244
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aztec/accounts

Implementation of sample account contracts for Aztec Network


Version published
Weekly downloads
565
increased by76.01%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

Accounts

Accounts is a client library that provides implementations for some common account flavors. Use it to acquire a Wallet object that corresponds to an account, and use that together with @aztec/aztec.js to interact with the network.

Installing

npm install @aztec/accounts

Account types

  • Schnorr: Uses an Grumpkin private key with Schnorr signatures for authentication, and a separate Grumpkin private key for encryption. Recommended for most use cases.
  • ECDSA: Uses an ECDSA private key for authentication, and a Grumpkin private key for encryption. Recommended for building integrations with Ethereum wallets.
  • SingleKey: Uses a single Grumpkin private key for both authentication and encryption. Recommended for testing purposes only.

Usage

Deploy a new account

import { getSchnorrAccount } from '@aztec/accounts/schnorr';
import { GrumpkinPrivateKey } from '@aztec/circuit-types';

const encryptionPrivateKey = GrumpkinPrivateKey.random();
const signingPrivateKey = GrumpkinPrivateKey.random();
const wallet = getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitDeploy();
console.log(`New account deployed at ${wallet.getAddress()}`);

Create a wallet object from an already deployed account

import { getSchnorrAccount } from '@aztec/accounts/schnorr';

const wallet = getSchnorrWallet(pxe, encryptionPrivateKey);
console.log(`Wallet for ${wallet.getAddress()} ready`);

FAQs

Last updated on 07 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc