6 dias
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,35 mil
6
O conteúdo apresentado nesta página é fornecido por terceiros. Salvo indicação em contrário, a OKX não é o autor dos artigos citados e não reivindica quaisquer direitos de autor nos materiais. O conteúdo é fornecido apenas para fins informativos e não representa a opinião da OKX. Não se destina a ser um endosso de qualquer tipo e não deve ser considerado conselho de investimento ou uma solicitação para comprar ou vender ativos digitais. Na medida em que a IA generativa é utilizada para fornecer resumos ou outras informações, esse mesmo conteúdo gerado por IA pode ser impreciso ou inconsistente. Leia o artigo associado para obter mais detalhes e informações. A OKX não é responsável pelo conteúdo apresentado nos sites de terceiros. As detenções de ativos digitais, incluindo criptomoedas estáveis e NFTs, envolvem um nível de risco elevado e podem sofrer grandes flutuações. Deve considerar cuidadosamente se o trading ou a detenção de ativos digitais é adequado para si à luz da sua condição financeira.