Protocol hooks

How the facilitator would call Regent protocol contracts as side-effects (scaffold)

In layers.md, the facilitator is described as more than a settlement service: it can call Regent protocol contracts as side-effects of payments.

Live vs planned

  • Planned: the current facilitator does not yet implement Regent-specific revenue distribution hooks.

  • Planned: settlement events trigger protocol-level accounting and routing.

Intended hook points

On verify

  • validate payment requirements

  • record “intent” telemetry (optional)

On settle (successful)

  • persist payment event (“x402 history”)

  • call protocol contracts to:

    • apply protocol fees

    • route net revenue to the correct treasury

    • apply bond rake when underfunded

    • update registries (agent ↔ treasury ↔ token)

On settle (failure)

  • record failure telemetry

  • cleanup verification state

Conceptual flow

Internal references

Last updated