Skip to content

BIP Draft: Internet Payment Protocol for Bitcoin Payments#2112

Closed
shivaenigma wants to merge 1 commit intobitcoin:masterfrom
shivaenigma:master
Closed

BIP Draft: Internet Payment Protocol for Bitcoin Payments#2112
shivaenigma wants to merge 1 commit intobitcoin:masterfrom
shivaenigma:master

Conversation

@shivaenigma
Copy link

This BIP defines a protocol by which any actor can perform ecommerce over HTTP using bitcoin payments. It uses HTTP 402 status code

@jonatack
Copy link
Member

jonatack commented Mar 4, 2026

Thank you for your proposal. It doesn't appear to have followed the workflow described in the README and in https://github.com/bitcoin/bips/blob/master/bip-0003.md#workflow, and particularly the sections below. Please let us know if that is not correct. Closing for now.


README:

"People wishing to submit a BIP should first describe their idea to the bitcoindev@googlegroups.com mailing list to gather feedback on viability and community interest before working on a formal description. Please open a pull request to this repository only when substantial progress on the draft has been made, preferably when the draft is nearing completion."


BIP 3 workflow:

"After some investigation, the novelty and viability of the idea should be tested by posting a new, dedicated thread about the idea to the Bitcoin Development Mailing List. Prior correspondence can be found in the mailing list archive.

It is recommended that authors establish before or at the start of working on a draft whether their idea may be of interest to the Bitcoin community. Authors should avoid opening a pull request with a BIP draft out of the blue. Vetting an idea publicly before investing time and effort to formally describe the idea is meant to save time for both the authors and the community. Not only may someone point out relevant discussion topics that were missed in the authors’ research, or that an idea is guaranteed to be rejected based on prior discussions, but describing an idea publicly also tests whether it is of interest to more people beside the authors.

As a first sketch of the proposal is taking shape, the authors should present it to the Bitcoin Development Mailing List. This gives the authors a chance to collect initial feedback and address fundamental concerns. If the authors wish to work in public on the proposal at this stage, it is recommended that they open a pull request against one of their forks of the BIPs repository instead of the main BIPs repository."

@jonatack jonatack closed this Mar 4, 2026
Copy link
Member

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your submission. I don’t think this proposal makes sense as proposed.

Comment on lines +19 to +21
[https://www.coinbase.com/en-sg/developer-platform/discover/launches/x402 x402 Protocol] was announced in May 2025. It allows APIs, apps, and AI agents to transact seamlessly, unlocking a faster, automated internet economy. It has been widely adopted in the crypto / ecommerce ecosystem validating the need of crypto powered internet payment protocol. However, bitcoin support has been missing.

Given some historical context, support of HTTP status code 402 has been discussion in bitcoin since 2011 [https://bitcointalk.org/index.php?topic=3895.0 [1]] [https://www.reddit.com/r/Bitcoin/comments/27g1z0/402_payment_required_this_code_is_reserved_for/ [2]]. The community though hasn't formally published a protocol thus impeding its usage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitcoin on-chain payments are expected to take up to an hour to be confirmed. It is not clear to me what problem this BIP is addressing and especially it does not explain how the proposed idea improves the situation at all.

Copy link
Author

@shivaenigma shivaenigma Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This BIP is trying to standardize the use of HTTP 402 for bitcoin payments. In case of USDC x402 the tx confirms in a second or two and the resource is delivered synchronously as part of the HTTP response. For bitcoin, we add a unique nonce to the request. The client polls for transaction confirmation and then retries with nonce (Ref: x402bflow-1.png)

Implementing x402 in bitcoin has various challenges, which we delve into:

# Address Generation:
## In bitcoin wallets, unique address is generated for each ecommerce order. This doesn't scale in case of agentic payments as in a hour there could be thousands of order requests that cannot be rate limited with human captcha. Adddress generation without actual payments can only continue till BIP44 gap limit (default 20). High gap limit values result in slowing down funds discovery of the BIP44 wallet.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gap limit is more of an end-user problem. Businesses generally just register and track millions of addresses without much problem. The more crucial limitation is that it is unreasonable to expect that you will be able to add thousands of payments per hour to the Bitcoin network on chain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking millions of addresses is only possible for big exchanges. Try opening electrum for >100,000 addresses and it hangs or take more than hour to sync. Just to clarify out of millions of addresses, transaction will be only present on maybe 10-100 address. So the overhead lies in BIP 44 account discovery .

This is not a big problem currently for human e commerce as the store order system is captcha rate limited. However, in case of agents creating unique address for each request creates many unused addresses which we are trying to avoid.


# Client Request: Client makes a request to a resource server
# Payment Required Response: If no valid payment is attached, the server responds with a payment required signal and payment requirements
# Payment Payload Request: Client submits hex encoded data of bitcoin transaction signed with SIGHASH_SINGLE flag in the subsequent request. All inputs and one change output is signed. Client doesn't broadcast the transaction. Client also adds a unique nonce to uniquely identify the request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically unsound. If there are multiple inputs, each input with a SIGHASH_SINGLE flag would commit to a different output. Using SIGHASH_SINGLE is also completely insecure and would allow anyone that sees the transaction to attempt diverting the funds to their own wallet by creating a conflicting transactions. The expected outcome is that the sender has no guarantee that the payment actually goes to the recipient.

Copy link
Author

@shivaenigma shivaenigma Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I understand now why it is wrong. What I am trying to basically do is to have the agent partially sign the transaction with only its own outputs and have merchant later add his address. With this wallet address generation is deferred to only when a payment is made.

If something like this is possible with PSBT please suggest. I would be glad to incorporate it 😸

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of your proposal is basically trying to reinvent BIP 77 Async Payjoin.

@shivaenigma
Copy link
Author

Thank you for your proposal. It doesn't appear to have followed the workflow described in the README and in https://github.com/bitcoin/bips/blob/master/bip-0003.md#workflow, and particularly the sections below. Please let us know if that is not correct. Closing for now.

README:

"People wishing to submit a BIP should first describe their idea to the bitcoindev@googlegroups.com mailing list to gather feedback on viability and community interest before working on a formal description. Please open a pull request to this repository only when substantial progress on the draft has been made, preferably when the draft is nearing completion."

BIP 3 workflow:

"After some investigation, the novelty and viability of the idea should be tested by posting a new, dedicated thread about the idea to the Bitcoin Development Mailing List. Prior correspondence can be found in the mailing list archive.

It is recommended that authors establish before or at the start of working on a draft whether their idea may be of interest to the Bitcoin community. Authors should avoid opening a pull request with a BIP draft out of the blue. Vetting an idea publicly before investing time and effort to formally describe the idea is meant to save time for both the authors and the community. Not only may someone point out relevant discussion topics that were missed in the authors’ research, or that an idea is guaranteed to be rejected based on prior discussions, but describing an idea publicly also tests whether it is of interest to more people beside the authors.

As a first sketch of the proposal is taking shape, the authors should present it to the Bitcoin Development Mailing List. This gives the authors a chance to collect initial feedback and address fundamental concerns. If the authors wish to work in public on the proposal at this stage, it is recommended that they open a pull request against one of their forks of the BIPs repository instead of the main BIPs repository."

Thanks, I understand. I posted on the bitcoin dev mailing 7 days ago and still haven't seen my post appear. Not sure if the post was declined. Please suggest course of action on this. Should I repost ?

@murchandamus
Copy link
Member

I think this proposal is fundamentally incompatible with the reality of on-chain transactions. It would be a better fit for a system that is capable of instant payments such as the Lightning Network. However, LN already has L402: https://docs.lightning.engineering/the-lightning-network/l402

So, I don’t think it is necessary to repeat your submission, unless you find a novel way of how your proposal improves on an existing problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants