Skip to content

feat(tempo): add native multisig account support#4710

Merged
jxom merged 4 commits into
mainfrom
jxom/multisig
Jun 4, 2026
Merged

feat(tempo): add native multisig account support#4710
jxom merged 4 commits into
mainfrom
jxom/multisig

Conversation

@jxom
Copy link
Copy Markdown
Member

@jxom jxom commented Jun 4, 2026

Adds experimental native multisig (TIP-1061) account support to viem/tempo.

Summary

  • Account.fromMultisig(config) derives a synthetic local account representing the multisig sender. It is used purely for broadcasting / sender identity — it holds no key and throws on sign/signMessage/signTypedData.
  • Re-exports MultisigConfig from ox/tempo so callers pass a config directly (multisig: config); there is no separate Multisig wrapper type.
  • Auto-bootstrap: the first transaction from a multisig account registers it on-chain. init is derived from nonce == 0 during serialization — callers never pass init, gas, or type explicitly.
  • Broadcasting reuses core sendTransaction/sendTransactionSync with the multisig account + collected owner signatures.

Flow

import { Account, MultisigConfig } from 'viem/tempo'

const config = MultisigConfig.from({
  threshold: 2,
  owners: [
    { owner: owner_1.address, weight: 1 },
    { owner: owner_2.address, weight: 1 },
  ],
})
const account = Account.fromMultisig(config)

const request = await client.prepareTransactionRequest({ /* ... */, multisig: config })

const signature_1 = await client.signTransaction({ ...request, account: owner_1 })
const signature_2 = await client.signTransaction({ ...request, account: owner_2 })

const hash = await client.sendTransaction({
  ...request,
  account,
  signatures: [signature_1, signature_2],
})

Docs

  • New Account.fromMultisig API page (Accounts) and a Multisig Transactions guide (Tempo Transactions), both flagged experimental with an EXP sidebar badge.

Testing

  • Added multisig e2e tests in src/tempo/Account.test.ts (flat 2-of-2 init + subsequent, 2-of-3 M-of-N, weighted threshold, and hoisted-account send without explicit account).
  • Run against a multisig-enabled localnet:
    VITE_TEMPO_TAG=sha-3da8342 VITE_TEMPO_MULTISIG=true pnpm vitest run --config test/vitest.config.ts --project tempo src/tempo/Account.test.ts -t multisig
    
    Passes 4/4. tsc -b clean.

Also bumps ox to 0.14.29.

Add `Account.fromMultisig` and re-export `MultisigConfig` from `ox/tempo` to
support native multisig (TIP-1061) transactions. Prepare a request with
`multisig: config`, collect owner approvals via `signTransaction`, then
broadcast with the collected `signatures`. First tx auto-bootstraps the
account; `init` is derived from nonce 0.

Bumps `ox` to 0.14.29.

Amp-Thread-ID: https://ampcode.com/threads/T-019e8cab-fd02-709f-9185-a2766192718b
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
viem Ready Ready Preview, Comment Jun 4, 2026 9:50am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 4, 2026

🦋 Changeset detected

Latest commit: 679858a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 4, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedox@​0.14.291001009998100

View full report

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/viem@4710

commit: 0285b67

@jxom jxom merged commit 25c2d6a into main Jun 4, 2026
26 of 29 checks passed
@jxom jxom deleted the jxom/multisig branch June 4, 2026 09:48
@github-actions github-actions Bot mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant