A paid HyperBEAM service has 2 different accounting problems. The user pays with a token on AO, while the node needs a local balance it can check quickly enough to accept or reject a request.

We built the AO Payment Device to connect the two.

From an AO payment to local credit

The node operator configures a token, deposit address and local ledger. When a payment is imported, the device looks up the transfer on AO and checks that the token process produced the expected debit and credit notices for the same sender, recipient and quantity.

Only then does it schedule a local Credit-Notice into the node's HyperBEAM ledger. The AO transfer remains the source of the funds; the local ledger is the node's working account of how much credit that user has available.

Imports are recorded by token and AO message ID. Sending the same payment to the device again does not create another balance.

A native P4 ledger

The device implements P4's balance and charge calls directly. P4 can ask for the balance behind a signed request, reject an unfunded request before execution, then debit the requester and credit the operator when the work is complete.

The older setup needed a separate process-ledger@1.0 adapter between P4 and the local token process. AO Payment Device removes that extra layer and speaks to the ledger process itself.

This makes the payment path fairly easy to follow:

AO token transfer
-> verified payment notices
-> local HyperBEAM credit
-> P4 balance check
-> request execution
-> P4 charge

Withdrawals are separate

Moving credit inside the local ledger and moving AO tokens out of the node wallet are deliberately separate operations. Withdrawals must use the configured token and recipient, and require either the node's private withdrawal secret or a request signed by the operator.

Automatic withdrawal after a P4 charge is optional. A successful submission to an AO MU is also recorded as a submission, not treated as proof that the transfer has settled. That distinction is important when the node has to recover from an interrupted request without paying twice.

AO Payment Device is packaged as a standalone HyperBEAM Forge device. Node operators can build and verify the archive, publish its specification and implementation to Arweave, then select the published device through their resolver and trusted signer configuration.

The code, configuration examples and test flow are available at github.com/xylophonez/aopayment-device.