6z în urmă
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,36 K
6
Conținutul de pe această pagină este furnizat de terți. Dacă nu se menționează altfel, OKX nu este autorul articolului citat și nu revendică niciun drept intelectual pentru materiale. Conținutul este furnizat doar pentru informare și nu reprezintă opinia OKX. Nu este furnizat pentru a fi o susținere de nicio natură și nu trebuie să fie considerat un sfat de investiție sau o solicitare de a cumpăra sau vinde active digitale. În măsura în care AI-ul de generare este utilizat pentru a furniza rezumate sau alte informații, astfel de conținut generat de AI poate să fie inexact sau neconsecvent. Citiți articolul asociat pentru mai multe detalii și informații. OKX nu răspunde pentru conținutul găzduit pe pagini terțe. Deținerile de active digitale, inclusiv criptomonedele stabile și NFT-urile, prezintă un grad ridicat de risc și pot fluctua semnificativ. Trebuie să analizați cu atenție dacă tranzacționarea sau deținerea de active digitale este adecvată pentru dumneavoastră prin prisma situației dumneavoastră financiare.