简体   繁体   中英

Can a Bitcoin address be used to verify a signature made with a given private key?

Problem: I have a Bitcoin address, ie 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm. And I have a list of private keys which I am not sure where this address was derived from. I want to find out which of these private keys has derived that address (through public key). For the address above, the private key is 1 (00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01).

Per my understanding, there are different ways of deriving public keys from a private key (ECDSA being the most common, but also HD/BIP 32 | https://en.bitcoin.it/wiki/Private_key ). And then, from the public key, a BTC address can be generated (via multiple hashings and other operations | https://en.bitcoin.it/wiki/Address ), which makes it impossible to find the public key from a Bitcoin address.

If my assumptions above are correct, my question is: is it still possible to validate the relation between a private key and a Bitcoin address?

I wanted to sign a message with the private key and use a public key to validate that. Since I don't have the public key, I would have to derive one from the private key and then generate a Bitcoin address to compare with the one I have. But, then, what if the address was generated with the HD/BIP 32 method?

PS: I am using BouncyCastle and NBitcoin libs to run the tests.

If you are using Bitcoin Core and you want to know the Private Key that belongs to one of your addresses, go to Console or use RPC and call dumpprivkey "myaddress" .

And throw the Private Key on WIF format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM