<p>You can use node RPCs: <a href="https://developer.bitcoin.org/reference/rpc/getblockhash.html" rel="nofollow noreferrer"><code>getblockhash</code></a>, <a href="https://developer.bitcoin.org/reference/rpc/getblock.html" rel="nofollow noreferrer"><code>getblock</code></a> and <a href="https://developer.bitcoin.org/reference/rpc/gettxout.html" rel="nofollow noreferrer"><code>gettxout</code></a> for this. See example below.</p>
<p>First, call <code>bitcoin-cli getblockhash 871951</code>, which will return the block's hash: <code>0000000000000000000233611afd0d00f1e874d8f962c94bdebf40975432b95e</code></p>
<p>Then, by using <code>bitcoin-cli getblock 0000000000000000000233611afd0d00f1e874d8f962c94bdebf40975432b95e 2</code> you will get the block's content in JSON format. You can then use some JSON parser (e.g. <a href="https://jqlang.github.io/jq/" rel="nofollow noreferrer"><code>jq</code></a> command-line tool) to filter just the coinbase transaction (which will be the 1st transaction in the <code>tx</code> array):</p>
<pre><code>{
  &quot;txid&quot;: &quot;9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812&quot;,
  &quot;hash&quot;: &quot;76e359604e2aab1aa5e47829014f78bcbd0b89bd1ad5065f284b7ea44a2c146b&quot;,
  &quot;version&quot;: 2,
  &quot;size&quot;: 325,
  &quot;vsize&quot;: 298,
  &quot;weight&quot;: 1192,
  &quot;locktime&quot;: 0,
  &quot;vin&quot;: [
    {
      &quot;coinbase&quot;: &quot;030f4e0d04eeca44672f466f756e6472792055534120506f6f6c202364726f70676f6c642f40398451da2c000000000000&quot;,
      &quot;txinwitness&quot;: [
        &quot;0000000000000000000000000000000000000000000000000000000000000000&quot;
      ],
      &quot;sequence&quot;: 4294967295
    }
  ],
  &quot;vout&quot;: [
    {
      &quot;value&quot;: 5.46e-06,
      &quot;n&quot;: 0,
      &quot;scriptPubKey&quot;: {
        &quot;asm&quot;: &quot;1 3daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b&quot;,
        &quot;desc&quot;: &quot;rawtr(3daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b)#p35tdfgk&quot;,
        &quot;hex&quot;: &quot;51203daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b&quot;,
        &quot;address&quot;: &quot;bc1p8k4v4xuz55dv49svzjg43qjxq2whur7ync9tm0xgl5t4wjl9ca9snxgmlt&quot;,
        &quot;type&quot;: &quot;witness_v1_taproot&quot;
      }
    },
    {
      &quot;value&quot;: 3.20244687,
      &quot;n&quot;: 1,
      &quot;scriptPubKey&quot;: {
        &quot;asm&quot;: &quot;0 7086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2&quot;,
        &quot;desc&quot;: &quot;addr(bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38)#y9upg3rz&quot;,
        &quot;hex&quot;: &quot;00207086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2&quot;,
        &quot;address&quot;: &quot;bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38&quot;,
        &quot;type&quot;: &quot;witness_v0_scripthash&quot;
      }
    },
...
</code></pre>
<p>Then, you can extract just the <code>txid</code> and <code>vout.n</code> fields to generate a list of transaction outputs to check, e.g.:</p>
<pre><code>9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,0
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,1
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,2
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,3
</code></pre>
<p>Then, for each one you can call <code>gettxout</code>, e.g. <code>bitcoin-cli gettxout 9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812 0</code> and if the result prints anything then the TXO has not been spent yet. If nothing is printed then it has been spent already.</p>
<p>Result will look like this:</p>
<pre><code>{
  &quot;bestblock&quot;: &quot;00000000000000000000349653eb5d146e6336ea9a95a7a8bcd3fac852f8c908&quot;,
  &quot;confirmations&quot;: 4,
  &quot;value&quot;: 3.20244687,
  &quot;scriptPubKey&quot;: {
    &quot;asm&quot;: &quot;0 7086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2&quot;,
    &quot;desc&quot;: &quot;addr(bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38)#y9upg3rz&quot;,
    &quot;hex&quot;: &quot;00207086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2&quot;,
    &quot;address&quot;: &quot;bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38&quot;,
    &quot;type&quot;: &quot;witness_v0_scripthash&quot;
  },
  &quot;coinbase&quot;: true
}

</code></pre>
<p>All of this could be easily automated to process the block range you're interested in.</p>

CC BY-SA 4.0
2024-11-26T02:39:25.267Z
All of this could be done a lot simpler with `scantxoutset`?
Pieter Wuille
CC BY-SA 4.0
2024-11-26T08:48:51.233Z
I was looking at that but maybe I misunderstood the docs: doesn't that require you to know which address you're looking for? In that case you'd still have to run `getblock` to get list of addresses and then call `scantxoutset` on each.
bca-0353f40e
CC BY-SA 4.0
2024-11-26T12:54:53.357Z
Never mind, of course.
Pieter Wuille
CC BY-SA 4.0
2024-11-25T19:59:29.200Z
2024-11-25T19:59:29.200Z
bca-0353f40e
<p>I need to find an unknown address and all i know is that the address received 2 or more block rewards in January 2010 and never spent the coins, So i have used blockparser to dump addresses from 2009 to feb 2010 then filtered then with a file which contains all btc addresses with balance but i still have one hell of a list.</p>
<p>I need to filter further using addresses which never send out transactions but i don't know how to query that.</p>
<p>Please help.</p>

<blockchain><address>
Is it possible to get bitcoin address from Jan 2010 that still has balance and never send out transactions?
terry franklin
# Is it possible to get bitcoin address from Jan 2010 that still has balance and never send out transactions?

(Asked by: username_0 on 2024-11-25)

I need to find an unknown address and all i know is that the address received 2 or more block rewards in January 2010 and never spent the coins, So i have used blockparser to dump addresses from 2009 to feb 2010 then filtered then with a file which contains all btc addresses with balance but i still have one hell of a list.

I need to filter further using addresses which never send out transactions but i don't know how to query that.

Please help.

**Tags:** blockchain, address


---

## 1 answers

### Answer by username_1 on 2024-11-25. Score: 2 | Accepted answer

You can use node RPCs: [`getblockhash`](https://developer.bitcoin.org/reference/rpc/getblockhash.html), [`getblock`](https://developer.bitcoin.org/reference/rpc/getblock.html) and [`gettxout`](https://developer.bitcoin.org/reference/rpc/gettxout.html) for this. See example below.

First, call `bitcoin-cli getblockhash 871951`, which will return the block's hash: `0000000000000000000233611afd0d00f1e874d8f962c94bdebf40975432b95e`

Then, by using `bitcoin-cli getblock 0000000000000000000233611afd0d00f1e874d8f962c94bdebf40975432b95e 2` you will get the block's content in JSON format. You can then use some JSON parser (e.g. [`jq`](https://jqlang.github.io/jq/) command-line tool) to filter just the coinbase transaction (which will be the 1st transaction in the `tx` array):

```
{
  "txid": "9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812",
  "hash": "76e359604e2aab1aa5e47829014f78bcbd0b89bd1ad5065f284b7ea44a2c146b",
  "version": 2,
  "size": 325,
  "vsize": 298,
  "weight": 1192,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "030f4e0d04eeca44672f466f756e6472792055534120506f6f6c202364726f70676f6c642f40398451da2c000000000000",
      "txinwitness": [
        "0000000000000000000000000000000000000000000000000000000000000000"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 5.46e-06,
      "n": 0,
      "scriptPubKey": {
        "asm": "1 3daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b",
        "desc": "rawtr(3daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b)#p35tdfgk",
        "hex": "51203daaca9b82a51aca960c1491588246029d7e0fc49e0abdbcc8fd17574be5c74b",
        "address": "bc1p8k4v4xuz55dv49svzjg43qjxq2whur7ync9tm0xgl5t4wjl9ca9snxgmlt",
        "type": "witness_v1_taproot"
      }
    },
    {
      "value": 3.20244687,
      "n": 1,
      "scriptPubKey": {
        "asm": "0 7086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2",
        "desc": "addr(bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38)#y9upg3rz",
        "hex": "00207086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2",
        "address": "bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38",
        "type": "witness_v0_scripthash"
      }
    },
...

```

Then, you can extract just the `txid` and `vout.n` fields to generate a list of transaction outputs to check, e.g.:

```
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,0
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,1
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,2
9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812,3

```

Then, for each one you can call `gettxout`, e.g. `bitcoin-cli gettxout 9f71b8f4724ead5fa8521e1511867f599064c55237e374c013a5a30ec99be812 0` and if the result prints anything then the TXO has not been spent yet. If nothing is printed then it has been spent already.

Result will look like this:

```
{
  "bestblock": "00000000000000000000349653eb5d146e6336ea9a95a7a8bcd3fac852f8c908",
  "confirmations": 4,
  "value": 3.20244687,
  "scriptPubKey": {
    "asm": "0 7086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2",
    "desc": "addr(bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38)#y9upg3rz",
    "hex": "00207086320071974eef5e72eaa01dd9096e10c0383483855ea6b344259c244f73c2",
    "address": "bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38",
    "type": "witness_v0_scripthash"
  },
  "coinbase": true
}

```

All of this could be easily automated to process the block range you're interested in.

> **Comments:**
> **username_2**: All of this could be done a lot simpler with `scantxoutset`?  
> **username_1**: I was looking at that but maybe I misunderstood the docs: doesn't that require you to know which address you're looking for? In that case you'd still have to run `getblock` to get list of addresses and then call `scantxoutset` on each.  
> **username_2**: Never mind, of course.  

---

