Author

Topic: HOWTO GUIDE: Generating New Spork Keys (Read 423 times)

newbie
Activity: 3
Merit: 0
March 06, 2023, 09:45:21 AM
#5


Code:
openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/41534e31204f49443a20736563703235366b310a30740201010420/PrivKey: /' | sed 's/a00706052b8104000aa144034200/\'$'\nPubKey: /'



What are ### ? are them come from alert.hex  ? or where

openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/###########/PrivKey: /' | sed 's/###########/\'$'\nPubKey: /'



Hi, so maybe You discovered this issue)? Please can you expain it)? Thanks)
full member
Activity: 374
Merit: 101
I am a student
February 03, 2020, 11:35:55 AM
#4


Code:
openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/41534e31204f49443a20736563703235366b310a30740201010420/PrivKey: /' | sed 's/a00706052b8104000aa144034200/\'$'\nPubKey: /'



What are ### ? are them come from alert.hex  ? or where

openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/###########/PrivKey: /' | sed 's/###########/\'$'\nPubKey: /'

member
Activity: 179
Merit: 10
Works for me thx
but how to encode to base58 with another prefix?
member
Activity: 179
Merit: 10
Is not necessary convert the PUBkey to WIF format?
copper member
Activity: 44
Merit: 1
Since there was so many questions on how to generate spork keys here is my guide. I can't promise everything is entirely accurate but this is what worked for me:

Some friendly links:
http://lenschulwitz.com/base58
http://www.fileformat.info/tool/hash.htm
https://en.bitcoin.it/wiki/Wallet_import_format

Important: If you are going to change the prefixes for your coin, make sure to do that before this. Otherwise you will break things after you change prefixes

Use following command to generate ESCDA key. If final spork key is not a digit as first character of output it’s wrong from my testing.

openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/41534e31204f49443a20736563703235366b310a30740201010420/PrivKey: /' | sed 's/a00706052b8104000aa144034200/\'$'\nPubKey: /'

--- SAMPLE - DO NOT USE ---
PrivKey: 11265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb55
PubKey: 04ae5f52611fc9f3dcd3f2db88ad4a9b10ab218389cacd1ed07cc893af6ad2f3e6618090edb5403 8e5a26d2c6d04db4a6c901a8bf52a72fef484f478519fdf0b02
--- SAMPLE - DO NOT USE ---

1 - Take a private key:
11265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb55

2. Add a 0xef byte in front of it for testnet addresses or 0x80 for mainnet addresses. If you change these bytes in the chainparams.cpp, you have to use the changed bytes here.
Mainnet: 8011265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb55
Testnet: ef11265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb55

3 - Perform SHA-256 binary hash on the extended key - I used this tool: http://www.fileformat.info/tool/hash.htm
Mainnet: 9b861c61c65dd712d4ce27949e7a277626b2d8146f07b28144177b7fb188c300
Testnet: f7bcbbf85aa39c1568a24e1be8b7a0710a62742340a45cc239026069ced15901

4 - Perform SHA-256 hash on result of SHA-256 binary hash from step 3.
Mainnet: 1830fee682b46641133e8866a846093ec671714cf82e721500ff5bca00b3173c
Testnet: 12c046617eb7b3725c478f454c77a37c814a0147d6f55c57fd617d42bebe4606

5 - Take the first 4 bytes of the second SHA-256 hash, this is the checksum
Mainnet: 1830fee6
Testnet: 12c04661

6 - Add the 4 checksum bytes from step 5 at the end of the extended key from point 2
Mainnet: 8011265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb551830fee6
Testnet: ef11265dcc6d5e26dbabfac9699540e38e7ca6aad8842891d3e6322ea9ab2cbb5512c04661

7. Encode to base58 - http://lenschulwitz.com/base58

--- SAMPLE SPORK KEYS - DO NOT USE ---
Mainnet: 5HwqemD1riinKNfSeXoeQnbwCBLDrea7BXJ1BtBfYbYvSV9C9df
Testnet: 91iUEW2ZSwnvHSAjGshZHP9tqqgw1p7JXU9xGWYAtLHyDWcAPMA
--- SAMPLE SPORK KEYS - DO NOT USE ---

8. Shameless self promotion:
Check out the Historia project
https://bitcointalk.org/index.php?topic=5010022.80
https://historia.network



Jump to: