How do I get an address from a private key?

+1 vote
I refer to
However, I do not understand the two steps here. ex) 283D01856115B7970B622EAA6DAFF2B9ECE30F1B66927592F6EA70325929102B -> 0284E5235E299AF81EBE1653AC5F06B60E13A3A81F918018CBD10CE695095B3E24
and If I do Three step (SHA 256), I get different values.
ex) 0284E5235E299AF81EBE1653AC5F06B60E13A3A81F918018CBD10CE695095B3E24 -> 
but i get the 48ED57E20708C7392AE5DBA73776D0F91A42F87CD82FE4411ED4BA37260402ED
How can I get this 1C72D90868DBCD0252A54EFFB25FB535B4C89B67D57B75FD88465C5F173DCAB5?
The same is true in the process of obtaining a private key.

Different from bitcoin: Add the first version byte from the private-key-version blockchain parameter to the start of the private key. If it is more than one byte long, insert each subsequent byte of it after every floor(33/len(private-key-version)) bytes of the key. For example with 8025B89E:

-> 742D5B3C59BB25F077AACB33D5770AAE22FD5639E8F9A7742BADEF84BCDFB4CC

but i get the 4C76F1957D2C58C650C5CD601A48C7362BBCDA2FD2733B5A6BBA48DC4A961F2D
How do I get an address from a private key?


asked Dec 6, 2018 by hscho

1 Answer

0 votes

Before we get into the details of these steps, have you considered using the validateaddress API command? That can accept a private key as a parameter and returns the corresponding address as part of its response.

answered Dec 7, 2018 by MultiChain
Is it not so that while using validateaddress API command we can check only those addresses that are generated on a particular node, i.e. the node on which we are running this API command?

So what if we have to check for some other address that's not created on this node?
You can use validateaddress to check any address, not just those created on the node.