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 N
6
Nội dung trên trang này được cung cấp bởi các bên thứ ba. Trừ khi có quy định khác, OKX không phải là tác giả của bài viết được trích dẫn và không tuyên bố bất kỳ bản quyền nào trong các tài liệu. Nội dung được cung cấp chỉ nhằm mục đích thông tin và không thể hiện quan điểm của OKX. Nội dung này không nhằm chứng thực dưới bất kỳ hình thức nào và không được coi là lời khuyên đầu tư hoặc lời chào mời mua bán tài sản kỹ thuật số. Việc sử dụng AI nhằm cung cấp nội dung tóm tắt hoặc thông tin khác, nội dung do AI tạo ra có thể không chính xác hoặc không nhất quán. Vui lòng đọc bài viết trong liên kết để biết thêm chi tiết và thông tin. OKX không chịu trách nhiệm về nội dung được lưu trữ trên trang web của bên thứ ba. Việc nắm giữ tài sản kỹ thuật số, bao gồm stablecoin và NFT, có độ rủi ro cao và có thể biến động rất lớn. Bạn phải cân nhắc kỹ lưỡng xem việc giao dịch hoặc nắm giữ tài sản kỹ thuật số có phù hợp hay không dựa trên tình hình tài chính của bạn.

