Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: widewave on January 02, 2014, 02:48:12 PM



Title: How to get public key and scriptPubKey and scriptSig from private key?
Post by: widewave on January 02, 2014, 02:48:12 PM
Who can give me some clue in bitcoin code?
Thank you!


Title: Re: How to get public key and scriptPubKey and scriptSig from private key?
Post by: sidazhang on January 06, 2014, 06:00:15 AM
This question doesn't sound right. Could you post your specific case?

You can get your pubkey from your privateKey, that is called Elliptic curve crytography
scriptSig is signture + pubkey where the signature proves that you have the private key
scriptPubkey is typically something like op_dup op_hash160 pubkeyhash op_checksig or just pubkey op_checksig and the pubkey hash is the sha256 + hash160 of your publickey. But the question doesn't actually make a lot of sense I am afraid

Below is probably a good article to start you off.
http://procbits.com/2013/08/27/generating-a-bitcoin-address-with-javascript