4

I have read that private key is 256 bits or 32 byte. see here

I generated a key on bitcoin-test network.

WIF:

cVe4tA6QHduboeSiQD6Y6nzV1QjaVpDVG2YHbqbtJiSCxsNDYYUF

HEX:

f06e4a9c228dafff48e6a44eb9527a14374a203a5750de01c0cf39e7280ce45501

if you notice above hex is 33 bytes!

I went on to sign a transaction :

01000000015760c907060ca47bbf97a964a435387c38fd86c307e920c1d29ce1a3d0d4d56b010000001976a914ca560954433f0fd1bda9bb566607d1724559b0db88acffffffff02d0070000000000001976a914f9ad22432bb6eb5e4262f9e4bcfb09fda2f5167b88ace068be07000000001976a914ca560954433f0fd1bda9bb566607d1724559b0db88ac0000000001000000

generated the following tx hash:

01000000015760c907060ca47bbf97a964a435387c38fd86c307e920c1d29ce1a3d0d4d56b010000006b483045022100f2224f424a63675682f062fbf6699028727e13d26dc382af6dca57dfb21e9910022011b485e63f8f0045c40f8df41bcab13040bc554da4c176a380c81d18c615b210012103b9dc990c2b8a999ba68bf80cbff94fd85d62a01c7dc48252156f78c813b0aa67ffffffff02d0070000000000001976a914f9ad22432bb6eb5e4262f9e4bcfb09fda2f5167b88ace068be07000000001976a914ca560954433f0fd1bda9bb566607d1724559b0db88ac00000000

and when i broadcasted it got accepted!

Now my question is, how can 33 byte private key be valid signing key?

P.S. please don't take out the coins, they are worthless and i need for testing. thanks!

Karan
  • 183
  • 7

1 Answers1

4

Got it: the last byte 01 stands for compression and has to be dropped

Karan
  • 183
  • 7
  • cool, you found it - here was last recently a discussion on it: https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated/69322?noredirect=1#comment80498_69322 – pebwindkraft Mar 06 '18 at 13:51