JBaczuk / blockchain-dev-tools

Blockchain Development Tools
GNU General Public License v2.0
6 stars 10 forks source link

the following arguments are required: privkey #4

Open chrisbagsrocks opened 1 year ago

chrisbagsrocks commented 1 year ago

Not sure if I am missing something or the code is not working properly. From my understanding, ./pubkey.py should generate a private key and then it can be used to make a public key. Following How to Fork Bitcoin part 2 at the genesis block section, I assumed I could run that command and it would give a key but it is throwing an error error: the following arguments are required: privkey .

In the medium article it mentions $ sha256 "Welcome to blockchain fundamentals" but upon running sha256.py, gives me error sha256.py: error: the following arguments are required: value. I am using your instructions to fork Litecoin and have successfully up to this point when using blockchain-dev-tools

This seems like an easy fix that I am just misunderstanding so any help would be appreciated

JBaczuk commented 1 year ago

pubkey.py is for generating a public key from a private key. First you need to generate a private key (pretty much any SHA256 hash digest will do). Example:

$ sha256 "Welcome to blockchain fundamentals"
2358feea3003a1d16af3454be4cec2f6a7db43bfc7daa101b8949fff91ed64b4
$ pubkey -u 2358feea3003a1d16af3454be4cec2f6a7db43bfc7daa101b8949fff91ed64b4
048f74dca316b3faa7e947919babe20e274d5c1f4cf3366652bd360bb51322f652b575fd0461fb982fd9aabf39c879db9f08a5f505bb5671083bc085c1802eac56

You might find this site helpful: Blockchain Fundamentals. I also made a video course to go along with it: The Complete Bitcoin Programming Course.