BIP 0072: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Gavinandresen (talk | contribs)
Changed request param to just 'r'
934 (talk | contribs)
Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b5723035e23896d0/bip-0072.mediawiki
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{bip}}
{{bip}}
{{BipMoved|bip-0072.mediawiki}}


<pre>
<pre>
   BIP: 72
   BIP: 72
  Layer: Applications
   Title: bitcoin: uri extensions for Payment Protocol
   Title: bitcoin: uri extensions for Payment Protocol
   Author: Gavin Andresen <gavinandresen@gmail.com>
   Author: Gavin Andresen <gavinandresen@gmail.com>
   Status: Draft
  Comments-Summary: No comments yet.
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0072
   Status: Final
   Type: Standards Track
   Type: Standards Track
   Created: 29-07-2013
   Created: 2013-07-29
</pre>
</pre>


Line 25: Line 29:
The bitcoin: URI scheme is extended with an additional, optional
The bitcoin: URI scheme is extended with an additional, optional
"r" parameter, whose value is a URL from which a PaymentRequest
"r" parameter, whose value is a URL from which a PaymentRequest
message should be fetched (unsafe and reserved octets in the URL value
message should be fetched (characters not allowed within the scope
must be encoded as described in RFC 1738).
of a query parameter must be percent-encoded as described in RFC 3986
and bip-0021).


If the "r" parameter is provided and backwards compatibility
If the "r" parameter is provided and backwards compatibility
Line 33: Line 38:


When Bitcoin wallet software that supports this BIP receives a
When Bitcoin wallet software that supports this BIP receives a
bitcoin: URI with a r parameter, it should ignore the bitcoin
bitcoin: URI with a request parameter, it should ignore the bitcoin
address/amount/label/message in the URI and instead fetch a
address/amount/label/message in the URI and instead fetch a
PaymentRequest message and then follow the payment protocol, as
PaymentRequest message and then follow the payment protocol, as
Line 40: Line 45:
Bitcoin wallets must support fetching PaymentRequests via http and
Bitcoin wallets must support fetching PaymentRequests via http and
https protocols; they may support other protocols. Wallets must
https protocols; they may support other protocols. Wallets must
include an Accept HTTP header in HTTP requests:
include an "Accept" HTTP header in HTTP(s) requests (as defined
in RFC 2616):
 
<pre>Accept: application/bitcoin-paymentrequest</pre>
<pre>Accept: application/bitcoin-paymentrequest</pre>


If a PaymentRequest cannot be obtained (perhaps the server is
If a PaymentRequest cannot be obtained (perhaps the server is
unavailable), then the customer should be informed that the merchant's
unavailable), then the customer should be informed that the merchant's
payment processing system is unavailable.
payment processing system is unavailable. In the case of an HTTP
request, status codes which are neither success nor error (such as
redirect) should be handled as outlined in RFC 2616.


==Compatibility==
==Compatibility==
Line 55: Line 64:
A backwards-compatible request:
A backwards-compatible request:
<pre>
<pre>
bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&r=https%3A%2F%2Fmerchant.com%2Fpay.php%3Fh%3D2a8628fc2fbe
bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&r=https://merchant.com/pay.php?h%3D2a8628fc2fbe
</pre>
</pre>
Non-backwards-compatible equivalent:
Non-backwards-compatible equivalent:
<pre>
<pre>
bitcoin:?r=https%3A%2F%2Fmerchant.com%2Fpay.php%3Fh%3D2a8628fc2fbe
bitcoin:?r=https://merchant.com/pay.php?h%3D2a8628fc2fbe
</pre>
</pre>
[[Category:BIP]]
 
==References==
 
[[http://www.w3.org/Protocols/rfc2616/rfc2616.html|RFC 2616]] : Hypertext Transfer Protocol -- HTTP/1.1

Latest revision as of 18:00, 24 September 2019

This page describes a BIP (Bitcoin Improvement Proposal).
Please see BIP 2 for more information about BIPs and creating them. Please do not just create a wiki page.

Please do not modify this page. This is a mirror of the BIP from the source Git repository here.

  BIP: 72
  Layer: Applications
  Title: bitcoin: uri extensions for Payment Protocol
  Author: Gavin Andresen <gavinandresen@gmail.com>
  Comments-Summary: No comments yet.
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0072
  Status: Final
  Type: Standards Track
  Created: 2013-07-29

Abstract

This BIP describes an extension to the bitcoin: URI scheme (BIP 21) to support the payment protocol (BIP 70).

Motivation

Allow users to click on a link in a web page or email to initiate the payment protocol, while being backwards-compatible with existing bitcoin wallets.

Specification

The bitcoin: URI scheme is extended with an additional, optional "r" parameter, whose value is a URL from which a PaymentRequest message should be fetched (characters not allowed within the scope of a query parameter must be percent-encoded as described in RFC 3986 and bip-0021).

If the "r" parameter is provided and backwards compatibility is not required, then the bitcoin address portion of the URI may be omitted (the URI will be of the form: bitcoin:?r=... ).

When Bitcoin wallet software that supports this BIP receives a bitcoin: URI with a request parameter, it should ignore the bitcoin address/amount/label/message in the URI and instead fetch a PaymentRequest message and then follow the payment protocol, as described in BIP 70.

Bitcoin wallets must support fetching PaymentRequests via http and https protocols; they may support other protocols. Wallets must include an "Accept" HTTP header in HTTP(s) requests (as defined in RFC 2616):

Accept: application/bitcoin-paymentrequest

If a PaymentRequest cannot be obtained (perhaps the server is unavailable), then the customer should be informed that the merchant's payment processing system is unavailable. In the case of an HTTP request, status codes which are neither success nor error (such as redirect) should be handled as outlined in RFC 2616.

Compatibility

Wallet software that does not support this BIP will simply ignore the r parameter and will initiate a payment to bitcoin address.

Examples

A backwards-compatible request:

bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&r=https://merchant.com/pay.php?h%3D2a8628fc2fbe

Non-backwards-compatible equivalent:

bitcoin:?r=https://merchant.com/pay.php?h%3D2a8628fc2fbe

References

[2616] : Hypertext Transfer Protocol -- HTTP/1.1