3 天前
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,326
6
本页面内容由第三方提供。除非另有说明,欧易不是所引用文章的作者,也不对此类材料主张任何版权。该内容仅供参考,并不代表欧易观点,不作为任何形式的认可,也不应被视为投资建议或购买或出售数字资产的招揽。在使用生成式人工智能提供摘要或其他信息的情况下,此类人工智能生成的内容可能不准确或不一致。请阅读链接文章,了解更多详情和信息。欧易不对第三方网站上的内容负责。包含稳定币、NFTs 等在内的数字资产涉及较高程度的风险,其价值可能会产生较大波动。请根据自身财务状况,仔细考虑交易或持有数字资产是否适合您。