Skip to content

Commit

Permalink
update headers for BIP70 payment request
Browse files Browse the repository at this point in the history
Summary:
Badger Cash and RaiPay use "ecash-" instead of "bitcoincash-" in the headers.
I'm also going to apply the same change to Electrum ABC Bitcoin-ABC/ElectrumABC#213

Test Plan:
- Generate a payment URI: `curl -L -H 'Content-Type: application/json' -d '{"outputs":[{"address":"1NLcNpAaBBMekgBZk7NxwdxwtSUTfTV8Aq","amount":560}],"currency":"ecash"}' https://pay.badger.cash/create_invoice`
- Run `src/qt/bitcoin-qt`
- Menu `File` > `Open URI`
- Paste the "ecash:?r=<url>" (replace <url> with the url in the reply to the curl command, e.g. https://pay.badger.cash/i/DTKP4)
- Send

Repeat with the be.cash API:
`curl -L -H 'Content-Type: application/json' -d '{"values":{"network":"XEC","outputs":[{"value":3000,"scriptHex":"76a914154205358162a6f59457d83dea828a15261aaba388ac"}]}}' https://p.be.cash/create-invoice`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11543
  • Loading branch information
PiRK committed May 31, 2022
1 parent edb7be8 commit f90daf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ Bitcoin ABC version 0.25.7 is now available from:
<https://download.bitcoinabc.org/0.25.7/>

This release includes the following features and fixes:
- Redefine the BIP71 MIME types for eCash payment request messages to:

| Message | Type/Subtype |
|----------------|----------------------------------|
| PaymentRequest | application/ecash-paymentrequest |
| Payment | application/ecash-payment |
| PaymentACK | application/ecash-paymentack |
7 changes: 3 additions & 4 deletions src/qt/paymentserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const char *BIP70_MESSAGE_PAYMENTACK = "PaymentACK";
const char *BIP70_MESSAGE_PAYMENTREQUEST = "PaymentRequest";
// BIP71 payment protocol media types
const char *BIP71_MIMETYPE_PAYMENT = "application/bitcoincash-payment";
const char *BIP71_MIMETYPE_PAYMENTACK = "application/bitcoincash-paymentack";
const char *BIP71_MIMETYPE_PAYMENTREQUEST =
"application/bitcoincash-paymentrequest";
const char *BIP71_MIMETYPE_PAYMENT = "application/ecash-payment";
const char *BIP71_MIMETYPE_PAYMENTACK = "application/ecash-paymentack";
const char *BIP71_MIMETYPE_PAYMENTREQUEST = "application/ecash-paymentrequest";
#endif

//
Expand Down

0 comments on commit f90daf7

Please sign in to comment.