Skip to main content

Core Ops

The SDK encapsulates all ZK proving and contract call encoding under simple consistent interfaces. Functions commonly return call payloads that can be dispatched and paid for through connected signers and/or remote relayers or ERC-4337 bundlers and paymasters. Payloads are of form { chainId, to, data }.

Deposit

Fund a/multiple Bermuda account/s with ETH (autowrapped to WETH) or any ERC-20 token:

Yield-bearing stablecoins such as sDAI or sUSDC are supported out-of-the-box and provide a simple and secure means of private passive yield.

let payload = await sdk.deposit({
token: sdk.config.sUSDC,
recipients: [
{ to: 'alice.bay', amount: 100_000_000n },
{ to: 'bob.bay', amount: 42_000_000n }
]
})

Transfer

Transfer any shielded ERC-20 token to a/multiple Bermuda account/s:

let payload = await sdk.transfer({
spender: alice,
token: sdk.config.sUSDC,
recipients: [
{ to: 'bob.bay', amount: 42_000_000n },
{ to: 'charlie.bay', amount: 33_000_000n }
]
})

Withdraw

Withdraw any shielded ERC-20 token to a/multiple Bermuda account/s:

let payload = await sdk.withdraw({
spender: bob,
token: sdk.config.sUSDC,
amount: 22_000_000n,
to: 'whoami.eth'
})

The transfer and withdraw payloads should be sent through a relayer/bundler to prevent doxxing.