Bitcoin Forum
May 05, 2024, 06:57:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: HOWTO GUIDE: Generating New Spork Keys  (Read 413 times)
marshalljp (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 44
Merit: 1


View Profile
May 07, 2019, 03:05:50 PM
 #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



1714935468
Hero Member
*
Offline Offline

Posts: 1714935468

View Profile Personal Message (Offline)

Ignore
1714935468
Reply with quote  #2

1714935468
Report to moderator
1714935468
Hero Member
*
Offline Offline

Posts: 1714935468

View Profile Personal Message (Offline)

Ignore
1714935468
Reply with quote  #2

1714935468
Report to moderator
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
heal
Member
**
Offline Offline

Activity: 179
Merit: 10


View Profile
May 12, 2019, 02:00:59 PM
 #2

Is not necessary convert the PUBkey to WIF format?
heal
Member
**
Offline Offline

Activity: 179
Merit: 10


View Profile
May 12, 2019, 02:51:56 PM
Last edit: May 12, 2019, 04:43:26 PM by heal
 #3

Works for me thx
but how to encode to base58 with another prefix?
flyx
Full Member
***
Offline Offline

Activity: 374
Merit: 101


I am a student


View Profile
February 03, 2020, 04:35:55 PM
 #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: /'


Donate:
BTC:   bc1q3ghe565af3zq20u05qpm474eu8wsff7tflcfg3
ETH:  0xDFCaFeF24a398FB8AbF4ca363c04C267c45279E5
UraGun
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 06, 2023, 02:45:21 PM
 #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)
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!