<blockquote>
  <p>is the buffer pre-hashing always 65 bytes long, </p>
</blockquote>

<p>yes</p>

<blockquote>
  <p>since compressed keys were not supported?</p>
</blockquote>

<p>they were not used by anybody. but there were no changes in client to "implement/support" them</p>

<blockquote>
  <p>Or was it 64 bytes long (just &lt;256bit x>&lt;256bit y>) and there was no byte for the version prepended before hashing?</p>
</blockquote>

<p>no. the client was written with openSSL library. This library always appends prefix to public key bytes (this is standard encoding defined somewhere)</p>

CC BY-SA 3.0
2017-06-30T13:59:24.990Z
2017-06-30T13:59:24.990Z
amaclin
<p>As I understand, since bitcoin 0.6.x, compressed and uncompressed public keys are supported. And the process from the public key to the address has the step that puts a byte in front of the public key before hashing, like:</p>

<p><code>0x04&lt;256bit x&gt;&lt;256bit y&gt;</code> = buffer before hashing the uncompressed public key</p>

<p>or</p>

<p><code>[0x02|0x03]&lt;256bit x&gt;</code> = buffer before hashing the compressed public key</p>

<p>That implies that the buffer before the hashing is either 33bytes long or 65 bytes long.</p>

<p>My question: pre-0.6, all the way back to the first public version of bitcoin, is the buffer pre-hashing always 65 bytes long, since compressed keys were not supported? Or was it 64 bytes long (just <code>&lt;256bit x&gt;&lt;256bit y&gt;</code>) and there was no byte for the version prepended before hashing? </p>

<p>If it was just the 64bytes of the public key on clients pre-0.6, that means that for the same public key, if I ran that public key through the code path of both pre-0.6 bitcoin client and current bitcoin client (uncompressed fomat), the final bitcoin address would still be different, since the modern client would prepend the version byte?</p>

<public-key><address-generation>
Bitcoin public key pre-0.6 length before hashing
tstark81
# Bitcoin public key pre-0.6 length before hashing

(Asked by: username_0 on 2017-06-30)

As I understand, since bitcoin 0.6.x, compressed and uncompressed public keys are supported. And the process from the public key to the address has the step that puts a byte in front of the public key before hashing, like:

`0x04<256bit x><256bit y>` = buffer before hashing the uncompressed public key

or

`[0x02|0x03]<256bit x>` = buffer before hashing the compressed public key

That implies that the buffer before the hashing is either 33bytes long or 65 bytes long.

My question: pre-0.6, all the way back to the first public version of bitcoin, is the buffer pre-hashing always 65 bytes long, since compressed keys were not supported? Or was it 64 bytes long (just `<256bit x><256bit y>`) and there was no byte for the version prepended before hashing?

If it was just the 64bytes of the public key on clients pre-0.6, that means that for the same public key, if I ran that public key through the code path of both pre-0.6 bitcoin client and current bitcoin client (uncompressed fomat), the final bitcoin address would still be different, since the modern client would prepend the version byte?

**Tags:** public-key, address-generation


---

## 1 answers

### Answer by username_1 on 2017-06-30. Score: 2 | Accepted answer

> is the buffer pre-hashing always 65 bytes long,

yes

> since compressed keys were not supported?

they were not used by anybody. but there were no changes in client to "implement/support" them

> Or was it 64 bytes long (just <256bit x><256bit y>) and there was no byte for the version prepended before hashing?

no. the client was written with openSSL library. This library always appends prefix to public key bytes (this is standard encoding defined somewhere)


---

