8000 market: Track 104 — wallet signing, chain pinning, escrow watches by stpinkie · Pull Request #58 · stpinkie/rhizome · GitHub
[go: up one dir, main page]

Skip to content

market: Track 104 — wallet signing, chain pinning, escrow watches - #58

Merged
stpinkie merged 1 commit into
mainfrom
devin/track-104-market-wallet
Sep 29, 2026
Merged

stpinkie merged 1 commit into
mainfrom
devin/track-104-market-wallet

Conversation

@stpinkie
Copy link
Copy Markdown
Owner

Summary

Track 104 closes the signer gap from Track 103 — settlement_signer=wallet is now a real autonomous local signer, with chain pinning, a mainnet gate, and per-purchase escrow event watches.

  • pkg/settlement.WalletSender — signs locally with the shared web3 wallet key (PrivateKey → FillTxDefaults → SignTx → eth_sendRawTransaction); keyring or RHIZOME_WALLET_PASSPHRASE decryption, key material zeroed after each send. approval remains the default; direct stays for unlocked/dev endpoints.
  • pkg/web3.DecodeSignedTx — RLP decodes legacy + EIP-1559 signed transactions and ecrecovers the sender; FakeChain now serves eth_sendRawTransaction/eth_getTransactionCount/eth_estimateGas/eth_gasPrice, so wallet-signed buys land on-chain in tests — no mocked signing.
  • Chain pinning — live eth_chainId must equal escrow_chain_id at rail assembly and on every wallet SendTx; mismatches refuse. escrow_allow_mainnet (default false) refuses chain 1. wallet/direct on the fixture rail warn — fixture signs nothing.
  • Escrow watcher — cmd/rhizome-market/watch.go polls eth_getLogs per non-terminal purchase clone on escrow_watch_interval (default 60s, 0=off): Release→completed, Lock→disputed, Withdraw→refunded, Resolve→resolved (disputed stays watched for the arbiter), Verified audited. watch_block persists progress on the purchase record.
  • Catalog fields (escrow_allow_mainnet, escrow_watch_interval, updated settlement_signer), config.example, modules.md, sprint doc, ROADMAP, AGENTS, .todo.md all synced.

Test plan

  • TestBuy_WalletSignerEndToEnd — wallet-signed open+release land on FakeChain; provider balance moves
  • Signed-tx decode round-trips (legacy + EIP-1559, sender recovery)
  • Chain-pin mismatch refuses the rail; mainnet refused by default, assembles with opt-in
  • Watcher transitions: Lock→disputed, Release→completed, Resolve after disputed, watch_block persistence
  • Wallet-mode config fields, fixture-rail no-op warning, watch interval bounds
  • Full go test -p 1 -tags goolm,stdjson ./... — all packages, 0 failures
  • golangci-lint v2.13.2 — 0 issues; gofumpt/golines/gofmt/docs-lint clean

Recorded two-node testnet E2E stays deferred to v0.16.0 Track 132 — the rail is bound and test-proven but unverified on live Sepolia; docs mark it experimental.

Generated with Devin

settlement_signer=wallet lands the autonomous local signer:
WalletSender decrypts the shared web3 wallet key (keyring or
RHIZOME_WALLET_PASSPHRASE), fills, signs, and broadcasts raw txs;
keys are zeroed after each send. approval stays the default; direct
serves unlocked/dev endpoints.

Chain pinning checks live eth_chainId == escrow_chain_id at rail
assembly and again inside every wallet SendTx; chain 1 refuses unless
escrow_allow_mainnet=true. Signer modes on the fixture rail warn —
fixture signs nothing.

pkg/web3.DecodeSignedTx parses and ecrecovers legacy + EIP-1559 signed
transactions so FakeChain serves eth_sendRawTransaction (plus
getTransactionCount/estimateGas/gasPrice) — wallet-signed buys land
on-chain in tests.

The module runs a per-purchase escrow event watcher: eth_getLogs on
each non-terminal purchase's clone at escrow_watch_interval (default
60s, 0=off), transitioning on Release/Lock/Withdraw/Resolve/Verified
and auditing market.escrow.event; watch_block persists progress and
disputed stays watched for the arbiter's resolve.

Recorded testnet E2E remains deferred to v0.16.0 Track 132.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@stpinkie
stpinkie merged commit 70e540c into main Sep 29, 2026
14 checks passed
@stpinkie
stpinkie deleted the devin/track-104-market-wallet branch September 29, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

36C2

1 participant

0