I want the process changed from private key to public key.

+1 vote

I refer to https://www.multichain.com/developers/address-key-format/.

but i don't understand this step

  1. Start with a raw private ECDSA key:
    283D01856115B7970B622EAA6DAFF2B9ECE30F1B66927592F6EA70325929102B
  2. Take the corresponding public key generated with it, which can be in compressed or uncompressed format. The uncompressed version contains 65 bytes, consisting of 0x04, 32 bytes for the X coordinate and 32 bytes for the Y coordinate. The compressed version contains 33 bytes, consisting of 0x02 (Y is even) or 0x03 (Y is odd), followed by 32 bytes for the X coordinate. Below is a compressed example:
    0284E5235E299AF81EBE1653AC5F06B60E13A3A81F918018CBD10CE695095B3E24
 
and i have a three step but i get the different value
 
  1. Take the corresponding public key generated with it, which can be in compressed or uncompressed format. The uncompressed version contains 65 bytes, consisting of 0x04, 32 bytes for the X coordinate and 32 bytes for the Y coordinate. The compressed version contains 33 bytes, consisting of 0x02 (Y is even) or 0x03 (Y is odd), followed by 32 bytes for the X coordinate. Below is a compressed example:
    0284E5235E299AF81EBE1653AC5F06B60E13A3A81F918018CBD10CE695095B3E24
  2. Calculate the SHA-256 hash of the public key:
    1C72D90868DBCD0252A54EFFB25FB535B4C89B67D57B75FD88465C5F173DCAB5
i get the 48ED57E20708C7392AE5DBA73776D0F91A42F87CD82FE4411ED4BA37260402ED not 1C72D90868DBCD0252A54EFFB25FB535B4C89B67D57B75FD88465C5F173DCAB5
 
asked Dec 14, 2018 by Harry

1 Answer

0 votes
You need to calculate the sha256 of the binary public key, not its textual hexadecimal representation. So first convert 0284E5235E299AF81EBE1653AC5F06B60E13A3A81F918018CBD10CE695095B3E24 from hexadecimal to binary, then calculate its sha256, then express the result as hexadecimal.
answered Dec 14, 2018 by MultiChain
...