<p>Bitcoin does not have "sender addresses". It has transactions, which spend coins you have authority to spend from, and creates new coins with potentially different owners.</p>

<p>Listing the previous owners of coins as senders is a practice used by some block explorer websites, but is at best uninteresting and at worst may result in monetary loss:</p>

<ul>
<li>Not every script has a corresponding address.</li>
<li>The previous owner is not necessarily the sender (e.g. in the case of a service with multiple users, the addresses belong to the service, not the users).</li>
<li>You can't use these to refund coins (a property that is usually expected of a "sender address"), as in the case of a shared account, the address may be associated with a different user of the service.</li>
<li>Widely deployed privacy improvement techniques like CoinJoin result in transactions where only one of the transaction's inputs is related to the sender you care about, with no way to identify which.</li>
</ul>

<p>So what <code>listtransactions</code> shows you are always <strong>receive</strong> addresses:</p>

<ul>
<li>For a send entry, it lists the address the money was sent to.</li>
<li>For a receive entry, it lists the address the money was received on.</li>
</ul>

CC BY-SA 3.0
2017-10-16T05:28:38.103Z
2017-10-16T05:37:25.087Z
2017-10-16T05:37:25.087Z
Pieter Wuille
<p>I'm using bitcoind. Now I would like to access the transactions list of a particular account using the bitcoin-cli.  </p>

<p>I am using the <code>listtransactions accountname</code> command to get the transactions of a particular account.  </p>

<p>Example:</p>

<pre><code>listtransactions karthiktest
</code></pre>

<p>Result:</p>

<pre><code>[
  {
    "account": "karthiktest",
    "address": "mnXEfvmLFWz7Exn9oGaEeTN8Ayu7Le5CCz",
    "category": "receive",
    "amount": 0.30000000,
    "label": "karthiktest",
    "vout": 1,
    "confirmations": 18,
    "blockhash": "000000009d17b7b32567f9730b50f2b7e8623ae6c9d20f84d4c414914e214283",
    "blockindex": 86,
    "blocktime": 1507963431,
    "txid": "c94307bef9ece4afe41384e2cd453f183aa7a438899723906e8967e624bc7d6f",
    "walletconflicts": [
    ],
    "time": 1507962288,
    "timereceived": 1507962288,
    "bip125-replaceable": "no",
    "comment": "hello karthik",
    "to": "from arun"
  }, 
  {
    "account": "karthiktest",
    "address": "miDMgiqduYevZMsRxX4qrY9BD5eXYFmEzg",
    "category": "send",
    "amount": -0.10000000,
    "label": "mahesh123",
    "vout": 0,
    "fee": -0.00000765,
    "confirmations": 17,
    "blockhash": "0000000079c79a5d21af138c80544b307d4ac764b4ed343b84752114c77fc893",
    "blockindex": 76,
    "blocktime": 1507964632,
    "txid": "516c64595c8b7be12419199dd81ae5edd3f4281aa3e52f88c7e3561b901bf881",
    "walletconflicts": [
    ],
    "time": 1507964172,
    "timereceived": 1507964172,
    "bip125-replaceable": "no",
    "comment": "hello mahesh",
    "to": "from karthik",
    "abandoned": false
  }
]
</code></pre>

<p>Here in the JSON, it is showing two transactions <code>1 receive</code> and <code>1 send</code>.</p>

<p>Now, My requirement is: for <code>receive</code> transaction, I need to get the sender address and for <code>send</code> transaction, I need to get the receiver address(this can be done using the account field).  But I'm confused to get it with receive transaction.</p>

<p>Can anyone help me on this?</p>

<transactions><bitcoind><client>
bitcoind - sender and receiver address
RealSteel
# bitcoind - sender and receiver address

(Asked by: username_0 on 2017-10-16)

I'm using bitcoind. Now I would like to access the transactions list of a particular account using the bitcoin-cli.

I am using the `listtransactions accountname` command to get the transactions of a particular account.

Example:

```
listtransactions karthiktest

```

Result:

```
[
  {
    "account": "karthiktest",
    "address": "mnXEfvmLFWz7Exn9oGaEeTN8Ayu7Le5CCz",
    "category": "receive",
    "amount": 0.30000000,
    "label": "karthiktest",
    "vout": 1,
    "confirmations": 18,
    "blockhash": "000000009d17b7b32567f9730b50f2b7e8623ae6c9d20f84d4c414914e214283",
    "blockindex": 86,
    "blocktime": 1507963431,
    "txid": "c94307bef9ece4afe41384e2cd453f183aa7a438899723906e8967e624bc7d6f",
    "walletconflicts": [
    ],
    "time": 1507962288,
    "timereceived": 1507962288,
    "bip125-replaceable": "no",
    "comment": "hello karthik",
    "to": "from arun"
  }, 
  {
    "account": "karthiktest",
    "address": "miDMgiqduYevZMsRxX4qrY9BD5eXYFmEzg",
    "category": "send",
    "amount": -0.10000000,
    "label": "mahesh123",
    "vout": 0,
    "fee": -0.00000765,
    "confirmations": 17,
    "blockhash": "0000000079c79a5d21af138c80544b307d4ac764b4ed343b84752114c77fc893",
    "blockindex": 76,
    "blocktime": 1507964632,
    "txid": "516c64595c8b7be12419199dd81ae5edd3f4281aa3e52f88c7e3561b901bf881",
    "walletconflicts": [
    ],
    "time": 1507964172,
    "timereceived": 1507964172,
    "bip125-replaceable": "no",
    "comment": "hello mahesh",
    "to": "from karthik",
    "abandoned": false
  }
]

```

Here in the JSON, it is showing two transactions `1 receive` and `1 send`.

Now, My requirement is: for `receive` transaction, I need to get the sender address and for `send` transaction, I need to get the receiver address(this can be done using the account field). But I'm confused to get it with receive transaction.

Can anyone help me on this?

**Tags:** transactions, bitcoind, client


---

## 1 answers

### Answer by username_1 on 2017-10-16. Score: 1 | Accepted answer

Bitcoin does not have "sender addresses". It has transactions, which spend coins you have authority to spend from, and creates new coins with potentially different owners.

Listing the previous owners of coins as senders is a practice used by some block explorer websites, but is at best uninteresting and at worst may result in monetary loss:

* Not every script has a corresponding address.
* The previous owner is not necessarily the sender (e.g. in the case of a service with multiple users, the addresses belong to the service, not the users).
* You can't use these to refund coins (a property that is usually expected of a "sender address"), as in the case of a shared account, the address may be associated with a different user of the service.
* Widely deployed privacy improvement techniques like CoinJoin result in transactions where only one of the transaction's inputs is related to the sender you care about, with no way to identify which.

So what `listtransactions` shows you are always **receive** addresses:

* For a send entry, it lists the address the money was sent to.
* For a receive entry, it lists the address the money was received on.


---

