<p>Blocks with a version of 2 or greater are required to put their block height in the coinbase. Your example doesn't. (At some point in the future, version 1 blocks will probably be discouraged and then banned.)</p>

<p><a href="http://blockexplorer.com/tx/9b28e08dc0ddda87081a4b49eed615c55048eea44a71a6aac5ce343ea94d8517" rel="nofollow">Here's an example of one that does</a>:</p>

<pre><code>038232030650b25c7d0f8bfabe6d6d0ebaccab777b7b5f4745bc81a22654d2fde018c3e8f06823670f5e790cbde3b6010000000000000000454d432055533300
</code></pre>

<p>The block height is the first thing in the coinbase. 03 is how many bytes the number has. So the number is 0x823203 in Bitcoin's little endian byte ordering, or 0x033282 in the big-endian byte ordering that humans usually use. Convert this into decimal and you can see that this is block #209538.</p>

CC BY-SA 3.0
2012-11-25T18:23:27.613Z
2012-11-25T18:23:27.613Z
theymos
<p>I was looking on <a href="http://blockexplorer.com/" rel="nofollow">http://blockexplorer.com/</a> and saw a coinbase of 304602210088c72f5fae851934be23ea7f563ce0424397939480e52c27225efbd8c0c1fccc022100e882cc00e76ae150aefe76fa89a262198d4f1d67f95d2cc3a60ce189017c199901 and wondered what block it was a reward from. I didn't know if the coinbase has anything to do with what block it was generated in.</p>

<block><coinbase-transaction>
Is there any way to get the block number of generation from coinbase?
Joseph Havens
# Is there any way to get the block number of generation from coinbase?

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

I was looking on <http://blockexplorer.com/> and saw a coinbase of 304602210088c72f5fae851934be23ea7f563ce0424397939480e52c27225efbd8c0c1fccc022100e882cc00e76ae150aefe76fa89a262198d4f1d67f95d2cc3a60ce189017c199901 and wondered what block it was a reward from. I didn't know if the coinbase has anything to do with what block it was generated in.

**Tags:** block, coinbase-transaction


---

## 1 answers

### Answer by username_1 on 2012-11-25. Score: 3

Blocks with a version of 2 or greater are required to put their block height in the coinbase. Your example doesn't. (At some point in the future, version 1 blocks will probably be discouraged and then banned.)

[Here's an example of one that does](http://blockexplorer.com/tx/9b28e08dc0ddda87081a4b49eed615c55048eea44a71a6aac5ce343ea94d8517):

```
038232030650b25c7d0f8bfabe6d6d0ebaccab777b7b5f4745bc81a22654d2fde018c3e8f06823670f5e790cbde3b6010000000000000000454d432055533300

```

The block height is the first thing in the coinbase. 03 is how many bytes the number has. So the number is 0x823203 in Bitcoin's little endian byte ordering, or 0x033282 in the big-endian byte ordering that humans usually use. Convert this into decimal and you can see that this is block #209538.


---

