On-Chain Subscriptions: Why Your Infrastructure Shouldn't Own Your Data

Your BlockWire subscription doesn't live in our database. It lives on Base L2.

This design choice—storing subscriptions on-chain instead of in a traditional database—has profound implications for verifiability, composability, and portability.

The Traditional Model

Most infrastructure services store your configuration in their database:

  • Your subscription lives in their Postgres instance
  • They control the data
  • You can't verify it independently
  • If they disappear, your subscription disappears
  • Other services can't read your subscription state

This creates lock-in. Your infrastructure becomes a dependency you can't audit or escape.

The BlockWire Model

BlockWire subscriptions are stored on-chain via the BlockWire Registry contract:

solidity
// BlockWire Registry Contract
struct Subscription {
    address subscriber;
    string webhookUrl;
    uint8 eventMask;      // Bitmask of event types
    uint256 expiresAt;
    bytes32 webhookSecret;
}

When you subscribe, you submit a transaction to Base L2. The subscription is recorded on-chain. We read it, but we don't own it.

Why This Matters

Verifiable

Anyone can check if an agent is subscribed. Query the contract directly. No need to trust our API or our database. The blockchain is the source of truth.

typescript
// Anyone can verify a subscription
const subscription = await blockwireRegistry.getSubscription(
  subscriberAddress
);

if (subscription.expiresAt > Date.now()) {
  // Subscription is active
}

Composable

Other contracts can read subscription state. A governance contract can check if agents are subscribed before allowing proposals. A reputation system can verify subscription history. The subscription becomes a building block for other on-chain logic.

Trustless

We can't fake or backdate subscriptions. The blockchain enforces the rules. If a subscription expires, it expires. If it's active, it's active. No ambiguity, no manipulation.

Portable

Your subscription survives if we disappear. Another service can read the on-chain registry and service your subscription. The data is yours, not ours.

Practical Implications

Audit trails: Subscription history is permanently recorded on-chain. You can prove when you subscribed, for how long, and what events you requested.

Multi-service support: Multiple services could read the same on-chain registry and compete to service subscriptions. You're not locked into a single provider.

Contract integration: Smart contracts can check subscription status before executing logic. "Only subscribed agents can participate in this auction."

Dispute resolution: If there's a disagreement about subscription status, the on-chain state is authoritative. No "he said, she said"—just query the chain.

The Trade-off

On-chain storage costs gas. Subscriptions require a transaction to create or update. This is more expensive than a database write.

But the benefits—verifiability, composability, trustlessness, portability—are worth it for infrastructure that agents depend on. The subscription becomes infrastructure itself, not just data in someone else's database.

Beyond Subscriptions

This pattern applies to other EchoRift services:

  • CronSynth: Schedules can be optionally attested on-chain
  • Switchboard: Swarm registries are on-chain
  • Arbiter: Leadership proofs and term numbers are on-chain

The principle: critical state belongs on-chain. Infrastructure shouldn't own your data.


Part of the EchoRift infrastructure series. Learn more about BlockWire.