Skip to main content

Accounts

The primary account type provided by the SDK is the Bermuda account.

A secondary account type provided by the SDK are burner accounts which are used in stateless atomic stealth actions or stateful arbitrary developer-defined calls.

Throughout, the SDK supports both ethers and viem accepting Signer and WalletClient respectively as Ethereum wallets, common parameter name signer.

Moreover, passkeys are fully supported through a simple utility.

Bermuda Account

A Bermuda account is a typical shielded account consisting of a spending as well as an encryption key pair.

Keygen

Key generation can be performed via two mechanisms:

  • Seeding: User private key recommended in wallets

  • Signing: In dapps without private key access

Generally seed-based derivation should be preferred because signature-based key generation implies phishing attack vectors.

In Wallets

await bermuda.account({ seed: privateKey })

Using a user's private key as seed not only closes the additional phishing attack vectors but also entails the advantage of inheriting the main wallet's recovery setup, if existant.

In Dapps

await bermuda.account({ signer })

Where signer can be either ethers.Signer or viem.WalletClient.

Sub Accounts

A single main seed or signer can utilize multiple Bermuda sub accounts by specifying distinct id parameters:

await bermuda.account({ seed, id: 36 })

Address

account.address()
// 0xa10fb46e7936...

Returns a 64-byte hex-encoded Bermuda account address.

Balance

await bermuda.balance(account)
// { WETH: bigint, USDC: bigint, sUSDC: bigint, ... }

Returns the shielded balance of given Bermuda account.

The second parameter may be an array of token addresses to limit the listing to, otherwise balance uses the SDK's default token list for the configured chain as fallback.

Burner Account

Burner accounts are standard EIP-7702 accounts with support for custom implementations.

Generation

To perform stateful stealth actions you may want to (re)generate burner accounts and fund them with gas from shielded WETH:

await bermuda.burner({ spender, id, gasTank, implementation })

Where

  • spender is a Bermuda account
  • id the specific burner account's index
  • gasTank an optional (W)ETH amount to unshield onto the burner account
  • implementation custom EIP-7702 smart contract implementation

The EIP-7702 authorization is performed in line with the gas withdrawal during account setup.

Passkeys

To use passkeys as Ethereum wallets just use the wrapPasskey utility to obtain a viem.WalletClient which in turn can be passed to any SDK function requiring an Ethereum wallet signer:

let walletClient = await bermuda.wrapPasskey()

Multisig

Bermuda multisigs are virtual accounts implemented with FROST signatures that are a composition of Schnorr signatures produced by indivdual Bermuda key pairs. Because of that modular inheritance our multisigs do not manifest as separate SDK account types. However, we are soon releasing utility functions to perform multisig setup, signing, and related functionality.