0

I have a full node running bitcoin-core 0.16 bitcoind (not bitcoin-qt). Today I tried and failed to pay a bitpay "secure" payment protocol uri invoice via the cli. The uri was in the form bitcoin:?r=https://bitpay.com/i/... with no visible bitcoin address or amount. (Guess people can't be trusted to copy-paste the address correctly?). Not surprisingly, the usual sendtoaddress method called the uri invalid.

I curled the address hoping to get the real payment details so I could enter them manually, but I just got a 301 redirect to a page on bitpay.com saying the invoice has not been paid. Guess they filter on uagent or some other header.

I also googled it but only found explanations of what the payment protocol is, why bitpay is using it, and how to do it with popular UI wallets. Nothing about cli.

Does anyone know if/how this is possible with cli/rpc only? Or perhaps the magic header bitpay looks for to distinguish a wallet app from a browser so I can get the real address? If not, I plan to open a ticket with bitcoin core devs on adding it.

Update:

bitpay link as requested: bitcoin:?r=https://bitpay.com/i/97ghKmFG8HVJNEbxkVefV though it has now been payed (via bitcoin-qt ui) so its usefulness may now be limited.

2
  • You may find that there is some code magic in the redirect you experienced that would open/inform your wallet automatically if it has an installed URI handler. bitcoin: links often work on smartphones too but it depends on the wallet to install such handling. If it is not too much to ask concerning privacy, can you share the full bitcoin:URI?
    – Willtech
    Commented Mar 25, 2018 at 5:42
  • @Willtech question updated with link
    – memtha
    Commented Mar 26, 2018 at 16:01

3 Answers 3

0

My tool, PaymentBridge? It aims to solve your question. It's completely client-side, safe to use, but don't broadcast the transaction after creating it. Paste it when it asks you for the transaction. Good luck!

And, there you go: https://github.com/bitpay/jsonPaymentProtocol/blob/master/specification.md

Have you set the Content-Type to application/payment?

1
  • Good find on the bitpay spec on github. It seems "Accept: application/payment-request" is exactly the "magic header" I was looking for. I cannot test it now bc the link is now invalid, but I have tentatively accepted your answer. While I do not intend to use your service bc I hate relying on an online service more then necessary, your source code link gave me the info I needed to develop my own local version with bash+curl. For anyone else who may also have this question but who is not willing/able to do the conversion themselves, I tentatively recommend the service linked in this answer.
    – memtha
    Commented Mar 26, 2018 at 16:10
1

The payment protocol is only usable from the GUI (i.e. bitcoin-qt). It is supposed to be an interactive protocol so you cannot use it from the command line which is non-interactive (in the sense that you issue commands and get a response back instead of issue command and interact within the context of that command).

1
  • This is pretty much what I expected: no built-in cli compatibility. Thx.
    – memtha
    Commented Mar 26, 2018 at 15:58
0

Reading between the lines it seems Bitpay may have done this to allow payment with cash when you receive a payment request for Bitcoin.

You may find that there is some code magic in the redirect you experienced that would open/inform your wallet automatically if it has an installed URI handler. bitcoin: links often work on smartphones too but it depends on the wallet to install such handling.

According to Bitpay:

https://support.bitpay.com/hc/en-us/articles/115005559826-How-do-I-pay-without-a-payment-bitcoin-address-

C. Open the Payment In Your Wallet

If your wallet is on the device you're using to view the invoice, you can open the payment in your wallet by tapping "Open in wallet". Confirm everything is correct, and you can send the payment from your wallet.

This "Open in wallet" link should reveal the actual details even if it does not open in your wallet.

I cannot test this without an actual Bitpay link.

1
  • I found that article in my brief search. Unfortunately all I was able to get was another link to the same bitcoin: uri. Question updated with link, though it has now expired.
    – memtha
    Commented Mar 26, 2018 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.