Skip to content

register names from the allowance to a temporary owner of the wallet - #28

Merged
epoberezkin merged 29 commits into
simplex-chat:simplexfrom
brenzi-agent:ab/allowance-partner-owner
Nov 26, 2026
Merged

epoberezkin merged 29 commits into
simplex-chat:simplexfrom
brenzi-agent:ab/allowance-partner-owner

Conversation

@brenzi-agent

@brenzi-agent brenzi-agent commented Nov 25, 2026 •

Copy link
Copy Markdown

#27 is merged. simplex at 447574f is merged into this branch, so the diff holds only this PR's change.

With #27, the account with the allowance (W0) also owns each name until it is handed over, so W0's ownership history shows every partner name. This lets the operator register a name to a temporary owner Wn, another account of the same wallet, whose history then shows only that name; Wn needs no ETH. No contract changes (ens-contracts 6e035ada).

Pricing: an account with an allowance chooses the owner: "This account" or another connected account. The hint "To register this name to another account of this wallet, connect that account as well." shows when no other account is connected.

Info: Wn signs, as EIP-712 typed data, before W0's first transaction:

  • AcceptGeneralTerms or AcceptCommunityTerms (commitment, terms hash, nonce, deadline) on the name policy's domain;
  • RegisterName (name, owner Wn, duration, resolver, records, 14 dispute days, nonce, deadline) on the sponsor's domain.
    Each signature is checked against Wn before it is stored ("The wallet signed with an account other than {{signer}}." otherwise).

Transactions, all sent by W0: commitUnder…TermsWithSig(commitment, termsHash, Wn, nonce, deadline, sig), the wait, then registerWithCredit with owner Wn and Wn's signature. Changed terms after the commit are signed again by Wn and relayed by W0. The commit and register confirmations show an "Owner" row; Complete shows "{{name}} is registered to {{owner}}." The register page stays on Complete for the account whose stored registration names the name's owner, so W0 stays on it after registering to Wn; before, only a name owned by the selected account kept the page there, and W0 was moved to the name's profile.

Relayed offer and withdrawal: when the selected account has an allowance and another connected account holds the name, the holder signs ApproveName and the selected account sends approveWithSig, to the partner or to address 0. Both confirmations show a "From" row and a note: "Your wallet asks {{holder}} to sign this offer, then sends it from the selected account, which pays its network fee." and "Your wallet asks {{holder}} to sign this withdrawal, then sends it from the selected account, which pays its network fee."

What reaches the chain: W0 is the sender of Wn's commit, register and offer, so each Wn is linked to W0 (accepted); Wn's own history is its one name, the offer and the transfer.

Wallets: MetaMask signs typed data for any account permitted to the site, so W0 stays selected and Wn only needs to be connected. Tested on 26 Nov with a Ledger through MetaMask, on a local chain (chain ID 1337) running ens-contracts 6e035ada and this branch at 3ac283e: Wn's terms acceptance, registration consent and offer were each shown as "Review typed message" with the domain in clear (name, version, chain ID, verifying contract: the name policy, the sponsor, the registrar) and the message as a hash; W0's commit, registration and relayed offer were blind-signed transactions to those contracts; the name was registered to Wn and offered while W0 stayed selected. With Wn selected, the dApp offers the direct path, which Wn cannot pay without ETH.

Stale signatures: stored signatures count only at the signer's current nonces on the policy and the sponsor, and only while their deadline is later than maxCommitmentAge plus one hour; otherwise the Transactions step asks Wn to sign again before the commit. A failed commit offers "Try Again", which builds a new commit, and a commit naming Wn as acceptor is recognised from any sender. A signature's v of 0 or 1 is stored as 27 or 28.

Tests and CI: each test commit failed in CI before its code (runs 45614592149, 45629325773, 45642218563, 45811354161); the typed data is checked against the domain separators and type hashes read on mainnet. Head run 45812425117: the tests and the three builds pass.

Review: two blind review rounds, their findings fixed or answered. The relayed path's network fee includes a fixed margin of 60,000 gas for the signature checks and the first nonce writes.

Screenshots

The whole flow, with the MetaMask and Ledger screens of each signature and transaction, the offer and the partner's claim, is in the guide Registering names for partners with a Ledger. Below are only the screens that this PR adds or changes, captured at 3ac283e against #27 at 858b402, on a local chain with test accounts: W0 is account #1, with the allowance; Wn is account #2, 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC. A flip diff shows the base frame and the PR frame in turn.

  • Pricing with W0 and Wn connected: “Owner”, with “This account” and Wn. Flip diff.
    pricing-owner-choice
  • Pricing with W0 connected alone: “To register this name to another account of this wallet, connect that account as well.” Flip diff.
    pricing-owner-hint
  • Info with Wn chosen: “Your wallet first asks 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC to sign the terms and the registration of this name, then sends both transactions from this account, which pays their network fees.”
    info-temporary-owner
  • Info after the wallet signed with an account other than Wn: “The wallet signed with an account other than 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC.”
    info-signed-by-another-account
  • Complete: “wnpartnersix.simplex is registered to 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC.”, on which the page stays from 9b60c53.
    complete-registered-to
  • Withdrawal confirmation, sent by W0: the “From” row with Wn and “Your wallet asks 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC to sign this withdrawal, then sends it from the selected account, which pays its network fee.”
    withdraw-confirm-from

# Conflicts:
#	src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx
…er-owner

# Conflicts:
#	public/locales/en/register.json
#	src/components/pages/profile/[name]/registration/steps/Complete.test.tsx
#	src/components/pages/profile/[name]/registration/steps/Info.test.tsx
#	src/components/pages/profile/[name]/registration/steps/Info.tsx
#	src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.test.tsx
#	src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx
#	src/components/pages/profile/[name]/registration/steps/Transactions.test.tsx
#	src/components/pages/profile/[name]/registration/steps/Transactions.tsx
#	src/hooks/gasEstimation/calculateTransactions.test.ts
#	src/hooks/registration/useSimulateRegistration.ts
#	src/hooks/useRegistrarAllowance.ts
#	src/hooks/useRegistrationReducer.test.ts
#	src/transaction-flow/transaction/registerName.test.ts
#	src/transaction-flow/transaction/registerName.ts
#	src/utils/snrcSponsor.test.ts
#	src/utils/snrcSponsor.ts
@epoberezkin
epoberezkin merged commit e5c7212 into simplex-chat:simplex Nov 26, 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.

3 participants