BRIDGE-AUDIT-9 — Asset Custody, Mint/Burn, Settlement and Recovery¶
Base main: 88ae52ce75c64108d33df4ac65152386a4239064 (PR #1181). This change completes local economic execution and simulation. It does not authorize a production route, invent issuer support, or qualify unavailable source custody infrastructure. Exact inputs, test results, bytecode sizes, diagnostics and checksums are retained in settlement-qualification. The associated PR records the qualified commit and main integration; no self-referential commit hash is embedded in its own tree.
Actual value execution¶
Every canonical GatewayRouter420.initiateOutbound call, including the compatibility ABI and initiateFundedOutbound, now reserves actual sender value before dispatch. A qualified BridgeValueCustody420 burns an approved representation, locks approved liquidity, or observes the actual native-provider debit. Reservation, adapter dispatch, message uniqueness, lifecycle creation and risk accounting form one atomic transaction. An event, unsigned request, status label or elapsed timeout cannot authorize payment or a refund. Missing custody fails closed. Non-issuer users approve the qualified custody controller for representation burns or escrow debits; native provider users retain the provider adapter's approval path. These allowances cannot substitute for route admission, actual debit or authenticated delivery.
BridgeRepresentation420 supplies the non-issuer mint/burn implementation. Its immutable direct custody controller is its sole minter/burner; there is no administrator mint or controller setter. Burns require allowance. Its names explicitly identify bridged assets. USDC/CADC creation and incorrect native supply units are rejected; this module never designates a bridged token issuer-native. Canonical token registration, qualified source proof and approved route bindings remain mandatory. No representation is deployed or made canonical by these simulations.
Inbound proof admission reserves exposure but does not create spendable backing. Actual mint/release or a qualified native-provider balance-change receipt is required before COMPLETED. completeInboundSettlement permits a previously admitted, still-authorized inbound transfer to finish without consuming its proof again. Qualified mint/burn supply is checked against actual total supply; lock/release accounting is checked against actual escrow. Canonical token/code substitution and rogue supply cannot be hidden by equal governance reconciliation numbers.
| Asset class | Destination execution | Source withdrawal and qualification boundary |
|---|---|---|
| ETH and approved Ethereum ERC-20 routes | Explicit bridged representation or approved prefunded lock/release token; exact units/deltas | EthereumDepositGateway420 now implements actual ETH/ERC-20 release, permanent paid/cancelled identifiers and original-owner deposit refunds. Requires qualified finalized-420 burn/escrow and cancellation/refund backing verifier; none is production approved. |
| BTC | Qualified representation burn, retained pending claim | Existing BitcoinCustody420 signing/UTXO reservation and six-confirmation SPV checks; BitcoinCustodyOutcome420 binds the actual current canonical paid transaction to the immutable transfer and request. Real owned custody, unspent-input/backing authority (including independently funded miner fees) and isolated signer remain external. Signing revocation does not erase a real payment fact. No timeout-based BTC cancellation is implemented. |
| SOL and SPL | Same qualified local supply/escrow interfaces and canonical mint mapping | Typed public outbound request remains transport, not a release instruction. Existing SBF program is deposit-only. Real source release/ownership authority remains unqualified and routes inactive. |
| BNB, DOGE, LTC, XRP, TRX, POT, BOB, CURE, ARRR | Same non-issuer local execution with native units and independently bound routes | Reuses qualified chain-specific admission boundaries. Missing source custody, signing/payment/cancellation proof services remain explicitly inactive dependencies. POT/ARRR native-evidence gaps are unchanged. No generic status or verifier ABI is promoted to native source authority. |
| USDC | Circle native mint and balance delta, gross minted exposure including fees | Actual CCTP native burn only; qualified delivery receipt required to close the pending obligation. Generic local remint/refund is prohibited. Circle 420 support and deployment remain absent. |
| CADC | Qualified native OFT/OFTAdapter delivery and observed balance delta | Actual native provider debit and qualified peer/security configuration; remote payment evidence required for completion. Generic issuer refunds prohibited. Issuer authorization and destination deployment remain absent. |
Settlement, failure and recovery¶
An inbound transfer settles when actual authorized destination value movement and matching evidence are committed atomically with completion. An outbound transfer settles only after a qualified outcome verifier authenticates the actual remote payout, complete immutable transfer tuple, recipient hash, native transaction identity, unique proof identity and original transfer qualification. Local burns and SOURCE_PENDING requests remain outstanding obligations. BTC's established six-confirmation policy is probabilistic finality, not a claim of mathematical irreversibility. Its backing/signing provider must prove that miner fees are separately funded or explicitly charged under an approved fee policy, leaving source reserves sufficient for circulating and pending claims. The controlled backing double and payout SPV qualify interfaces/payment facts, not aggregate owned reserves or unspentness.
FAILED, EXPIRED, RETRYABLE, PAUSED and DISPUTED workflow labels do not return funds. Retry preserves the original funding and consumed source/message identity. A cancellation refund requires authenticated irreversible cancellation of every payment authorization, including signed replacements. Ethereum source cancellation writes a permanent barrier before any destination refund can occur; that source barrier must itself be authenticated as finalized. Old valid payout backing cannot cross it. An actual refund restores tokens/escrow and risk exposure exactly once. Native issuer recovery stays provider-owned and fails closed locally when unsupported.
An admitted but unminted inbound deposit can be irreversibly disputed. That dispute cannot be retried/resumed into a positive workflow. sourceRefundIntent requires the source replay key to remain consumed, no delivery, current qualification and the immutable transfer. The source gateway refunds only the original depositor after authenticating that irreversible intent. Only authenticated actual source repayment permits resolveSourceRefund to close the local reservation; no local tokens are minted. Delivered or issuer-native deposits cannot use this path.
Partial token failures, dispatch failures, failed proof verification and changed qualification roll back value, proof consumption, lifecycle and risk state together. Completed/refunded outcomes and used proof IDs are permanent. Revocation suspends new authority; a freshly approved outcome implementation can resolve an existing obligation against its original domain without resetting replay state. Custody checks the approved INBOUND/OUTBOUND permission mask at execution and rechecks the original reservation approval after dispatch. An inbound-only approval cannot burn or close outgoing claims; an outbound-only approval cannot mint incoming value. Ethereum source payouts/cancellations require outbound approval. Component replacement cannot inherit approval: custody pins the qualification registry/runtime and separately probes the router, transfer/route/risk/accounting registries and canonical asset registry. Each probe respects the existing fixed 50,000-gas bound. Direct custody identity is enforced; a proxy cannot silently replace its immutable controller. Any deployment replacement must retain authenticated liabilities and replay state under the existing qualification requirements.
Exposure and authority¶
Route and asset maximum exposure includes circulating/backed liability plus pending outbound obligations. Admitted but unsettled inbound exposure is reserved and cannot fund withdrawals. Payment reduces outstanding obligations; cancellation restores circulating exposure without opening extra cap room. Source repayment removes only the associated unminted reservation. Provider fees count at the actual gross native supply created, while recipients are checked at their actual net amount.
Only the canonical qualified router may consume risk or move custody. The router independently requires current custody qualification before funding, fallback delivery or outcome recovery; Registry registration and a replacement contract claiming healthy balances are insufficient. Governance may configure, suspend, dispute or revoke; it cannot declare a refund/payment by supplying a label, fabricate token balances, bypass custody conservation, or silently inherit old approval after component/configuration substitution. Emergency withdrawal/recovery controls remain available under the established safety classes, without re-enabling normal transfers on suspended routes.
Qualification scope and remaining dependencies¶
Tests exercise actual production representation/custody/source-release implementations and controlled source authority certificates. Native CCTP/LayerZero tests reuse genuine historical protocol fixtures through their existing native implementations; controlled deployment, token balances and gateways are simulations, not historical funded 420 gateway evidence. No new blockchain-consensus implementation or unrelated full-suite replay is introduced. Original SHA/run evidence is preserved by explicit qualified source lineage.
Actual diagnostics include a bounded-probe gas failure (corrected by separate bindings), invalid legacy request-only fixtures (converted to funded execution), and compiler resource termination from overlapping isolated builds (subsequent qualification shares one build graph). Review also closed an unqualified custody-substitution path at the router, covered by an explicit no-funding impostor regression. Interrupted or superseded passes are not counted as final qualification.
Live source custody/backing/outcome authorities, deployed approved tokens/gateways, native protocol/issuer support, owned BTC keys/UTXOs and genuine funded cross-chain settlement remain in the existing testnet work roadmap. Production approvals remain empty and profiles inactive. The repository's existing next work is that deployment-dependent bridge qualification; no numbered BRIDGE-AUDIT-10 is present in the authoritative repository roadmap and none is invented here.
Permission correction evidence scope¶
The final five permission regressions qualify direction-restricted approvals, successful permitted mint/burn/payment, and a custody-verifier mutation during dispatch that must roll back funding and lifecycle state. The earlier passing local runs use custody mask 3, source-payout mask 2 and unchanged custody approvals during successful dispatch. Their permitted behavior is unchanged by these added gates. Their original logs/hashes are retained, with both prior source snapshots and qualified lineage to the final guarded implementations. Only these affected permission paths are requalified; passing consensus, ingress and full-permission cases are not redundantly repeated.
Verified local results¶
160 distinct targeted cases passed, including 12,500 fuzz inputs and 512 invariant runs / 32,768 calls with zero invariant reverts. Ten source-input manifests retain the exact tested sources and the explicitly qualified permission-guard lineage. All compiled production bridge artifacts meet EIP-170; the maximum current runtime is 23,129 bytes. The inventory/provenance, provider and remaining-adapter checks pass. No new GitHub Actions run was launched. Original historical runs 43563876850 and 43563876854 remain at their original source SHA; they are not relabeled as tests of this change.