When creating an account, you can specify the signers that will be used to authorize the transactions. The SDK will install and set up the corresponding validator modules to authorize the signers of your choice. The account will use the same configuration across all chains.

Signers

At its core, Rhinestone accounts support two validation modules: ECDSA (for EOAs) and WebAuthn (for passkeys). You can then mix and match those validators to tailor them to your use case.
  • EOAs: you can use embedded wallets (Privy, Dynamic), external wallets (MetaMask, Coinbase), and server-side (agent) wallets. See below for an example of using an external wallet as the account owner.
  • Passkey: use device biometrics to authorize transactions. Learn more about using passkeys.
  • Multisig: use multiple signers of the same type to validate transactions. Learn more about using multisigs.
  • MFA: use passkeys and EOAs at the same time. Learn more about using MFAs.

Example

Here, we create an account owned by an external wallet like MetaMask and send our first transaction.
1

Install dependencies

Install viem and @rhinestone/sdk:
npm install viem @rhinestone/sdk
2

Initialize Viem

Initialize Viem client for the browser wallet:
const chain = sepolia;

const accountClient = createWalletClient({
  chain,
  transport: custom(window.ethereum!),
  account: eoaAddress,
});
3

Initialize Rhinestone account

Create an account using the external wallet as the sole owner:
const account = walletClientToAccount(accountClient);
console.log(account);

const rhinestoneAccount = await createRhinestoneAccount({
  owners: {
    type: "ecdsa",
    accounts: [account],
  },
});
console.log(rhinestoneAccount);

const accountAddress = rhinestoneAccount.getAddress();
console.log(accountAddress);
4

Make a transaction

Make your first transaction with the smart account:
const transactionResult = await rhinestoneAccount.sendTransaction({
  chain,
  calls: [
    {
      to: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      data: "0x",
    },
  ],
});
console.log(transactionResult);
This will prompt a signature request from the browser wallet and create and submit the transaction from the smart account.