Bitcoin Forum
June 20, 2024, 09:52:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Private key calculations  (Read 702 times)
RentGPU (OP)
Sr. Member
****
Offline Offline

Activity: 661
Merit: 258


View Profile
August 26, 2017, 09:15:19 PM
Merited by ABCbits (1)
 #1

Say i don't want to generate a random private key , but i want to convert a number to be my private key , so i tried to do the steps but it seems the sha256 online calculators are not working in the same way, the steps 1-add0x80 byte 2-sha256(step1) 3-sha255(step2) 4-first 4bytes 5-add first 4 bytes to step1(checksum).....the problem here is i use the sha256 online calculators to convert the first step but the result is not anything like it should be , if you know any online calculators i can use plz tell me , thx

2016 GPU Miner
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
August 26, 2017, 10:18:38 PM
 #2

Are you hashing the number as a string? Is it in decimal or hex?

You must be hashing your number as bytes. Otherwise it will not be correct as you would be hashing a string.

slavikus
Newbie
*
Offline Offline

Activity: 6
Merit: 1


View Profile
August 27, 2017, 11:08:32 AM
Merited by ABCbits (1)
 #3

You can also play around and verify your results with http://gobittest.appspot.com/Address
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
August 27, 2017, 01:12:50 PM
Merited by ABCbits (1)
 #4

Here you go:
Step2 SHA256: http://www.fileformat.info/tool/hash.htm?hex=800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D
Step3 SHA256: http://www.fileformat.info/tool/hash.htm?hex=8147786c4d15106333bf278d71dadaf1079ef2d2440a4dde37d747ded5403592

Those online tools like this one http://passwordsgenerator.net/sha256-hash-generator/ you use are treating your Hex as a string.

P.S. Example was taken from wiki, and I hate the person who added _SAMPLE_PRIVATE_KEY_DO_NOT_IMPORT_ to the copied result  Angry Be careful to remove it when you are trying to test and copy things or it will cause you a lot of headache since you may not know why the result is wrong with first look.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
August 29, 2017, 07:24:49 AM
 #5

besides the ones already mentioned, I used these links to play with keys and addresses:

https://www.bitaddress.org/
http://lenschulwitz.com/base58
http://ciyam.org/rawtx_helper.html
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!