<p>This is my understanding based on reading <a href="https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki" rel="nofollow">BIP 70</a> and the Bitcoin Core source, and a few tests.</p>

<p>A BIP 70 payment request contains, among other things, a destination address, an amount, and an HTTPS payment URL.  When you open the payment request with the Bitcoin Core client (as a file or via a <code>bitcoin</code> URI with an embedded link to the payment request), you are shown the Send dialog with fields pre-filled as per the request.  When you click "Send", the transaction is signed, but rather than being broadcast on the p2p network immediately, a message is POSTed to the payment URL, containing the signed transactions and also a refund address.  It is then the requester's responsibility to broadcast the transaction after checking that it matches the request.</p>

<p>So in particular, the refund address is sent directly to the recipient over HTTPS, who is responsible for storing it in case it should later be needed.  It is not part of the transaction, is not sent on the Bitcoin p2p network, and never appears in the block chain (unless it is later actually used to send a refund).</p>

<p>Bitcoin Core will automatically generate a refund address; the GUI doesn't provide an option to let you specify it.  Actually, the details are as follows: it checks for an <a href="https://en.bitcoin.it/wiki/Accounts_explained" rel="nofollow">account</a> named <code>"Refund from [requester]"</code>.  If that account exists and contains an address, it uses that address as the refund address; otherwise it creates the account and a new address within it (from the <a href="https://en.bitcoin.it/wiki/Key_pool" rel="nofollow">key pool</a>).  So you can find the refund address via the <code>getaddressesbyaccount</code> console command, but it doesn't appear to be otherwise exposed by the GUI.</p>

<p>You can try this: there is an <a href="https://bitcoincore.org/~gavin/createpaymentrequest.php" rel="nofollow">online payment request generator for Testnet</a> (and <a href="https://github.com/gavinandresen/paymentrequest" rel="nofollow">its source</a>).  If you generate a request, open it with Bitcoin Core, and send the payment, you will find that <code>listaccounts</code> shows a new account named <code>"Refund from www.bitcoincore.org"</code>, and <code>getaddressesbyaccount "Refund from www.bitcoincore.org"</code> will show you the refund address that was generated and sent.</p>

CC BY-SA 3.0
2014-04-11T02:11:15.267Z
That is impressive. +1
Doug Peters
CC BY-SA 3.0
2014-04-10T01:32:08.250Z
2014-04-10T01:32:08.250Z
Nate Eldredge
<p>In the <a href="https://bitcoinfoundation.org/blog/?p=541">what’s new in Bitcoin Core 0.9.0</a> notes there is a reference to a <strong>refund address</strong>. I tried to look it up in the forums and the wikis but I came up with nothing. </p>

<ul>
<li><p>How can I set a <code>refund address</code> when sending money from the <code>QT client</code>?</p></li>
<li><p>How can I retrieve the <code>refund address</code> for a transaction from <code>bitcoin-cli</code>?</p></li>
</ul>

<bitcoind><bitcoin-core><protocol>
Transaction refund address
Doug Peters
# Transaction refund address

(Asked by: username_0 on 2014-04-08)

In the [what’s new in Bitcoin Core 0.9.0](https://bitcoinfoundation.org/blog/?p=541) notes there is a reference to a **refund address**. I tried to look it up in the forums and the wikis but I came up with nothing.

* How can I set a `refund address` when sending money from the `QT client`?
* How can I retrieve the `refund address` for a transaction from `bitcoin-cli`?

**Tags:** bitcoind, bitcoin-core, protocol


---

## 1 answers

### Answer by username_1 on 2014-04-10. Score: 4 | Accepted answer

This is my understanding based on reading [BIP 70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) and the Bitcoin Core source, and a few tests.

A BIP 70 payment request contains, among other things, a destination address, an amount, and an HTTPS payment URL. When you open the payment request with the Bitcoin Core client (as a file or via a `bitcoin` URI with an embedded link to the payment request), you are shown the Send dialog with fields pre-filled as per the request. When you click "Send", the transaction is signed, but rather than being broadcast on the p2p network immediately, a message is POSTed to the payment URL, containing the signed transactions and also a refund address. It is then the requester's responsibility to broadcast the transaction after checking that it matches the request.

So in particular, the refund address is sent directly to the recipient over HTTPS, who is responsible for storing it in case it should later be needed. It is not part of the transaction, is not sent on the Bitcoin p2p network, and never appears in the block chain (unless it is later actually used to send a refund).

Bitcoin Core will automatically generate a refund address; the GUI doesn't provide an option to let you specify it. Actually, the details are as follows: it checks for an [account](https://en.bitcoin.it/wiki/Accounts_explained) named `"Refund from [requester]"`. If that account exists and contains an address, it uses that address as the refund address; otherwise it creates the account and a new address within it (from the [key pool](https://en.bitcoin.it/wiki/Key_pool)). So you can find the refund address via the `getaddressesbyaccount` console command, but it doesn't appear to be otherwise exposed by the GUI.

You can try this: there is an [online payment request generator for Testnet](https://bitcoincore.org/~gavin/createpaymentrequest.php) (and [its source](https://github.com/gavinandresen/paymentrequest)). If you generate a request, open it with Bitcoin Core, and send the payment, you will find that `listaccounts` shows a new account named `"Refund from www.bitcoincore.org"`, and `getaddressesbyaccount "Refund from www.bitcoincore.org"` will show you the refund address that was generated and sent.

> **Comments:**
> **username_0**: That is impressive. +1  

---

