Holding contracts
The no-key per-domain boxes behind held tips. One factory per network deploys identical wallet contracts at deterministic addresses; a keeper hot key relays hub-verified claims and refunds.
Architecture
Payer → deterministic per-domain contract
Hub authorization → factory owner/keeper relay
├─ release(domain, creator) → creator + treasury split
└─ refund(domain, payer, amount) → payer
Factory owner → rotate keeper/ownerNothing holds a key to a box. The wallets have no owner-only withdrawal: the only exits are release (creator + treasury split) and refund (payer in full), and both are callable solely by the factory during a factory-level call.
The factory and boxes are not proxies, clones, beacons, or UUPS contracts. Changing the implementation source cannot change an existing deployment. A new factory also derives different CREATE2 addresses because the factory and wallet init code are inputs to the address. A migration must keep the old factory route available for old tips and send only newly created tips to the new version; every row must retain its network, factory version/address, and box address. Funds do not migrate automatically.
Roles
| Role | Testnet | Mainnet | Powers |
|---|---|---|---|
| Owner | 0x796a…CD68 | treasury 0x558e…9D12 | setKeeper, setOwner |
| Keeper | on-chain keeper (0xA0B9…894) | on-chain keeper (0xb518…6e5) | release, refund on the factory |
| Anyone | — | — | deploy, predict, walletFor (permissionless reads/deploys) |
There is no direct owner-withdraw function, but both the owner and keeper may call release and refund with recipient arguments. The contract does not verify website ownership, payer signatures or Hub receipt rows itself. Correct recipient authorization depends on the Hub and these privileged keys.
Addresses
| Testnet | Mainnet | |
|---|---|---|
| Factory | 0xf127a645d7c02a12e0a93b135f8acf9c3332e518 | 0x3b25846c3332fcb8140e2ab60aad2b7fb401fe87 |
Both factories pin the same immutables: USDC 0x3600…0000, held-tier feeBps 500, Gateway domain 26, plus the per-network Gateway wallet/minter.
Both active factories and their embedded TipHoldingWallet source were
verified through Sourcify on 24 Oct 2026. Sourcify reports a reproducible
match for testnet
and mainnet .
This verifies source-to-bytecode correspondence; it is not an audit or a
claim that each deterministic child box has a separate Sourcify record.
Address derivation
domainHash(domain) = keccak256(bytes(domain)). A domain’s box is:
CREATE2(
deployer = factory address,
salt = domainHash,
initCode = TipHoldingWallet creation code ++ abi.encode(
factory, usdc, treasury, feeBps, gatewayWallet, gatewayMinter, domain)
)predict() computes this; walletFor() returns the address only if code is already deployed there, else address(0); deploy() deploys with the domain hash as salt (idempotent — returns the existing wallet if present). The SDK predicts the identical address offchain from the factory address plus the wallet init-code hash, so payers can fund a box before any code exists there.
Functions
TipHoldingFactory
| Function | Access | Behavior |
|---|---|---|
predict(bytes32) | view | The CREATE2 box address for a domain hash |
walletFor(bytes32) | view | The address, or 0x0 when undeployed |
deploy(bytes32) | anyone | Materialize the box; emits HoldingDeployed |
release(bytes32, creator) | owner-or-keeper | Deploy-if-needed, forward to the wallet, emit HoldingReleased |
refund(bytes32, payer, amount) | owner-or-keeper | Deploy-if-needed, forward to the wallet, emit HoldingRefunded |
setKeeper(address) | owner | Rotate the automation key |
setOwner(address) | owner | Rotate ownership (e.g. to treasury) |
TipHoldingWallet
Constructor stores immutables: factory, usdc, treasury, feeBps, gatewayWallet, gatewayMinter, domain (feeBps capped at 5000).
| Function | Access | Behavior |
|---|---|---|
release(bytes32, creator) | factory-only, nonReentrant | fee = balance × feeBps / 10000; payout = balance − fee → creator; fee → treasury if nonzero; revert empty on zero balance; emit Released |
refund(bytes32, payer, amount) | factory-only, nonReentrant | value = min(amount, balance); transfer to payer in full, no fee; revert empty on zero; emit Refunded |
isValidSignature(bytes32, bytes) | anyone | ERC-1271 self-authorization for Gateway self-withdrawals (self-transfer intents only) |
Key reverts: factory-only (direct calls to a wallet), owner-or-keeper (stranger release/refund), empty (zero box balance), creator/payer (zero address), reentrant.
Gas notes
A first touch of a domain deploys the box: deployment gas in addition to the release/refund call. Later operations reuse the deployed box. Actual costs depend on gas used and the configured network’s gas price. Keep the keeper funded — claims and refunds fail without relayer gas.
Security properties
- Contract-held funds with privileged relays: boxes have no EOA private key. The factory owner/keeper authorizes exits; Hub checks bind the supplied recipients to verified claims and payer records.
- Payer refund policy: the Hub verifies the payer and computes the refund from held rows. The wallet contract trusts the factory’s
payerargument; it does not independently enforce original-payer identity. - Atomic splits:
releasepays creator and treasury in one transaction — no half-paid state. - Balance bounds and indexing: a release distributes the current balance; a refund is capped by the current balance. The Hub tracks claimed/refunded rows. Database and chain completion are separate, so uncertain relay outcomes require reconciliation before another relay.
- Single-wallet binding: the hub records one verified wallet per domain; a later different wallet returns
409, never auto-release.
Reconciliation runbook
When a claim/refund operation is marked submitted or
reconciliation-required, do not clear it and do not relay again. Read the
stored transaction hash, confirm the receipt on the operation’s recorded
network, and decode exactly one matching wallet event (Released or
Refunded). Compare the event’s domain hash, recipient/payer, gross amount,
and protocol fee with the immutable operation snapshot and affected tip IDs.
Only then finalize the database rows in one transaction or, if the transaction
never landed and the nonce is known unused, delete the reservation for a new
attempt. Escalate any mismatch for manual ledger repair. There is deliberately
no timeout that silently unlocks a money operation.
See Nib Tips for the product flows and the agent flow for exact request shapes.