On October 7, I reproduced a payment flow in which one completed transfer paid for three different jobs. Each request returned HTTP 200. The jobs produced different results, but all three responses referred to the same payment transaction.

The transfer itself was valid. The problem was how a successful payment result reached the application: recovering an earlier payment receipt allowed the current request's handler to run again.

I reported this privately to the Solana team. The maintainers fixed it in Pay Kit PR #361, and the project later added my GitHub account, snuff12, to its security acknowledgements through PR #371.

Pay Kit connects HTTP requests to payments

Solana Pay Kit provides client and server SDKs for adding a payment requirement to an HTTP route. It supports x402 and MPP, the Machine Payments Protocol. A client can be a person using a tool, a script, or an agent buying an API operation. Pay Kit overview at the fix revision, MPP specifications

The basic flow is:

  1. The client requests an operation.
  2. The server responds with 402 Payment Required and payment terms.
  3. The client supplies a payment credential, meaning the proof and information needed to verify the payment.
  4. The server verifies payment and runs the application handler.

My reproduction covered a fixed-price MPP charge using a transaction credential in the TypeScript implementation. I wanted to understand what happened when the server saw that completed payment again.

One transfer and three different jobs

I used the public createPayKitClient.fetch and pay.fetch APIs, a real local Node HTTP server, and an offline Surfpool environment that executed the SPL Token program. The fixture used disposable keys and a synthetic token with six decimals.

At the reviewed commit, the packages identified themselves as @solana/pay-kit 0.13.0 and @solana/mpp 0.11.0. The source revision was 9f47b85. These identify the tested source; published-package exposure needs its own release analysis.

One job cost 0.01 synthetic tokens, or 10,000 raw units. I completed a payment for job A, then reused its credential with requests for jobs B and C:

RequestHTTP responseCumulative token transfersCumulative jobs executed
Job A with the payment credential20011
Job B with the same credential20012
Job C with the same credential20013

The server returned computed results of 3, 10 and 19 for those jobs. The merchant received 10,000 raw units in total, and the payer's token balance moved from 1,000,000 to 990,000. There was one sendTransaction call and one successful ledger transfer, with meta.err = null.

That combination established the payment-to-work mismatch: the ledger recorded one payment while the application performed three distinct operations. I published a compact observation record with the source revision, environment, test hash and measurements from the seven historical checks.

These results came from the October 7 local experiment. They describe synthetic-token execution, rather than a production incident or measured loss of real customer funds.

When the behavior matters

The affected path accepted the completed transaction credential again while the challenge remained valid and the payment terms still matched. A fixed-price API could then execute another job under the earlier payment.

For a service that sells a fresh calculation, generated result or other operation per payment, each extra execution consumes work that should have its own authorization. A service intentionally returning an already purchased result has a different retry contract. The application needs to make that contract explicit.

My requests were sequential, and the shared store supported atomic updates. The reproduction did not require concurrent requests. It also succeeded with fee sponsorship disabled and with a new Pay Kit instance sharing the same in-memory store. That instance check did not test a process restart or durable storage.

Receipt recovery reached the handler again

The replay store already tracked the payment. In the reviewed implementation, a matching record in the confirmed state was classified as retry. Replay-state inspection

The charge verifier used that classification to recover a successful receipt for the existing transaction. It verified the payment without making another transfer. Its stored binding covered the challenge and payment terms; it did not retain the application's completed job result. Charge verification before the fix

At the next layer, pay.fetch called requirePayment and then invoked the handler when payment was accepted. A recovered receipt therefore led into the handler for the current request. Application wrapper

Before the fix, an already completed charge credential could recover a successful receipt and reach the handler again. After the fix, the consumed credential is rejected before another handler execution.

The completed-charge path. Recovery of an uncertain settlement has separate rules.

The boundary these tests exposed was between confirming a payment and authorizing another unit of work. Both layers needed to agree on what a completed charge permitted.

Controls made the scope clearer

I varied the setup to understand which conditions actually changed the result:

ControlObserved result
Disable fee sponsorshipOne payment still authorized three jobs.
Use a new instance sharing the replay storeA different job still executed under the earlier payment.
Derive externalId from the current jobThe changed job still executed; its receipt retained the first job's external ID.
Raise the current price from 0.01 to 0.10 synthetic tokensThe earlier payment was rejected with 402.
Advance time beyond the default 120-second challenge lifetimeThe credential was rejected and no extra work ran.
Cache the request body and result by payment transaction in the applicationThe same body returned its stored result; a different body returned 409.

The last control also changed what I measured. The handler was invoked three times, but the expensive work ran once. Checking only handler entry counts would have described that case incorrectly. This result-cache control was exercised sequentially; it was not a concurrency-tested replacement for the upstream fix.

All seven local checks passed. Their scope was the fixed MPP charge transaction-proof path. Other payment protocols and intents require their own tests.

The upstream fix made completed charges single use

The maintainers chose to reject a completed charge credential on reuse. The fixed verifier rejects the earlier retry classification, and final consumption checks that the matching record is still pending before changing it to confirmed. Atomic store updates coordinate that transition; the fallback lock covers one process. Fixed charge verifier, consumption implementation

The added Pay Kit regression tests submit the same credential with bodies A, B, C and A. They expect the first request to return 200, each later request to return 402, one transaction broadcast, and only job A to execute. Those upstream tests stub Solana RPC. Their evidence is separate from my earlier HTTP-server and offline-ledger reproduction. Upstream regression suite

Uncertain settlements still need recovery. The merged PR describes confirmation-only reconciliation without blind rebroadcast, with access granted at most once. It also retains the requirement for shared atomic replay storage in distributed deployments. Fix and recovery policy

Private disclosure and acknowledgement

My contribution was reproducing and reporting the completed-payment replay behavior. The maintainers authored the fix and the broader regression work in PR #361. That PR includes other corrections and test infrastructure alongside the issue I reported.

EventDate in Asia/Seoul
Local ledger reproduction recordedOctober 7, 2026
Maintainer fix merged in #361October 8, 2026
Acknowledgement merged in #371October 12, 2026

In the public disclosure discussion, I recorded that Ludo had confirmed the report by email and invited the acknowledgement PR. I also committed to keeping reproduction details private until November. The project's security acknowledgements now credit snuff12 for reporting multiple handler executions from one payment.

What I check in a paid API now

I now track payment settlement, handler invocation and actual work execution separately. A useful test needs to show how many transfers occurred, which payment each response references, and which jobs really ran.

I also ask what a retry is supposed to recover. An uncertain settlement, a completed operation's stored response, and a request for new work need explicit handling. The client and server should preserve that meaning across their boundaries.

For an agent buying API calls, this is part of the service contract: what did this payment authorize, and can the server demonstrate that it granted that work only as intended?

✳

Thanks for reading. Keep following your curiosity.

NEXT NOTE ↗

When Missing Values Break Solana SDKs