Il y a 6 j
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 k
6
Le contenu de cette page est fourni par des tiers. Sauf indication contraire, OKX n’est pas l’auteur du ou des articles cités et ne revendique aucun droit d’auteur sur le contenu. Le contenu est fourni à titre d’information uniquement et ne représente pas les opinions d’OKX. Il ne s’agit pas d’une approbation de quelque nature que ce soit et ne doit pas être considéré comme un conseil en investissement ou une sollicitation d’achat ou de vente d’actifs numériques. Dans la mesure où l’IA générative est utilisée pour fournir des résumés ou d’autres informations, ce contenu généré par IA peut être inexact ou incohérent. Veuillez lire l’article associé pour obtenir davantage de détails et d’informations. OKX n’est pas responsable du contenu hébergé sur des sites tiers. La détention d’actifs numériques, y compris les stablecoins et les NFT, implique un niveau de risque élevé et leur valeur peut considérablement fluctuer. Examinez soigneusement votre situation financière pour déterminer si le trading ou la détention d’actifs numériques vous convient.