The @1shotapi team found a interesting failure mode while experimenting with @PayPal's $PYUSD for x402 payments which in hindsight may have been obvious.
Unlike $USDC, PYUSD (which is a @Paxos implementation) does not revert when calling `transferWithAuthorization` with a used nonce.
So if facilitator/validation logic does explicitly check for a used nonce onchain, the facilitator will tell the server that the tx is valid, and `/settle` will spend gas processing a transaction that does not transfer PYUSD but instead simply emits a `AuthorizationAlreadyUsed` event, which would let a customer use the paywalled API for free unless the facilitator is inspecting the emitted events.
This also presents an potential corner case for high-throughput uses cases for this type of implementation where a malicious user might send a large volume of x402 payments with the same nonce to a server, all of which would verify even if doing an onchain read, and the facilitator would end up paying the gas for bad txs that won't transfer PYUSD and also will not revert before inclusion in a block.
The only way for a facilitator to protect against this is to keep an offchain record of submitted nonces AND check that a `Transfer` event was emitted in the final settlement so that paywalled APIs aren't circumvented.
We'd be interested to here from x402 protocol contributors on this.
1,37 tn
6
Innehållet på den här sidan tillhandahålls av tredje part. Om inte annat anges är OKX inte författare till den eller de artiklar som citeras och hämtar inte någon upphovsrätt till materialet. Innehållet tillhandahålls endast i informationssyfte och representerar inte OKX:s åsikter. Det är inte avsett att vara ett godkännande av något slag och bör inte betraktas som investeringsrådgivning eller en uppmaning att köpa eller sälja digitala tillgångar. I den mån generativ AI används för att tillhandahålla sammanfattningar eller annan information kan sådant AI-genererat innehåll vara felaktigt eller inkonsekvent. Läs den länkade artikeln för mer detaljer och information. OKX ansvarar inte för innehåll som finns på tredje parts webbplatser. Innehav av digitala tillgångar, inklusive stabila kryptovalutor och NFT:er, innebär en hög grad av risk och kan fluktuera kraftigt. Du bör noga överväga om handel med eller innehav av digitala tillgångar är lämpligt för dig mot bakgrund av din ekonomiska situation.

