Off-Chain Attestation
Off-chain Capacity Signals¶
The commit-reveal scheme of sec:ewma provides MEV-resistant capacity updates but incurs latency of at least two block intervals plus a commit timeout (approximately 40 seconds on Base L2). For real-time routing decisions, this is prohibitive. We introduce an off-chain signed attestation protocol that reduces update latency to seconds while preserving the same on-chain EWMA smoothing and security guarantees.
Protocol.¶
Each sink \(k\) periodically measures its available capacity and produces a signed capacity attestation:
A capacity attestation is an EIP-712 typed data structure \(a = (\tasktype, k, c, t_s, n)\) where \(\tasktype\) is the task type, \(k\) is the sink address, \(c\) is the declared capacity, \(t_s\) is the timestamp, and \(n\) is a monotonically increasing nonce. The sink signs \(a\) as \(\sigma_k = \mathrm{Sign}_{sk_k}(a)\).
Signed attestations are disseminated via any off-chain channel (direct API calls, P2P gossip, or posted to a relay). Any party may collect a batch of attestations and submit them to the on-chain OffchainAggregator contract, which performs the following for each attestation in the batch:
-
Verify the ECDSA signature against the claimed sink address.
-
Check timestamp freshness: \(|t_{\text{now}} - t_s| < \Delta\) (we set \(\Delta = 600\) seconds).
-
Check nonce monotonicity: \(n > n_{\text{last}}(k)\) for the sink.
-
If valid, call the
CapacityRegistryto apply the same EWMA smoothing as the commit-reveal path (sec:ewma).
Invalid attestations (bad signatures, stale timestamps, replayed nonces) are silently rejected with logged events; valid ones update the smoothed capacity.
Latency comparison.¶
Under the commit-reveal path, a capacity update requires a commit transaction (1 block), a waiting period (20 blocks \(\approx 40\)s), and a reveal transaction (1 block), totaling approximately 44 seconds. The off-chain path requires only the time to collect and relay an attestation batch, plus one on-chain transaction for the batch submission. In practice, this reduces end-to-end latency to under 5 seconds on Base L2.
Gas comparison.¶
We measure gas costs on Base Sepolia (see sec:onchain-eval for full benchmarks):