-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Sign and verify message with bitcoin address and public key #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you start a forum thread about this? There was some concern about possible attacks revealing private keys if the attacker can send arbitrary data to be signed. Also some nits: indentation looks messed up on the git diff, and isn't there a better way to get a string into a vector ? |
Forum thread is available here : http://www.bitcoin.org/smf/index.php?topic=6428.0 |
Can you squash the 4 commits into one please? It'll make the commit history cleaner. |
ACK, once rebased as Gavin requested |
Also: consensus on the forums seems to be that making the padding: address+padding+message ... wouldn't hurt. |
Add padding to input (fixed string + address) before hashing
Here is the rebased commit plus address used as padding (cool feature the rebase/squash commands :p). |
Nice work, khalahan; thanks! I am not familiar with the JSON RPC protocol, so this may be a silly question: is it necessary for the server to echo some of the parameters back to the caller? (e.g.
Second question: why not use the |
The pubkey can indeed not be inferred from the address. I suggested on the forum to encode the pubkey in the signature output, so the verifymessage interface can take an address. (see http://www.bitcoin.org/smf/index.php?topic=6428.msg108668#msg108668) |
amiryal > there is no real need to echo some of the input parameters. Should i remove duplicates ? sipa > i replied on the forum |
The pubkey can be inferred from the address plus the signature value, however. |
I resurrected discussion on forum thread: https://bitcointalk.org/index.php?topic=6428.msg443377#msg443377 |
Closing, sipa has a more refined version. |
Move rounduint64, swapByteOrderN, test and "fix" rounduint64
Fix for no text shown in status bar when hovering minting button
Corrected IRC channel in README.md
- consistently sticking to "2-out-of-2" - rephrasing some sentences to make them more palatable. "obviously a lie" is a bit aggressive. - avoid using exaggerating terms like "very expensive", just state the facts without too many emotions
Adds two rpc commands :
It allows to sign a message with the public key of a bitcoin address you own, to be sure of the identity of the sender.
Command : ./bitcoind signmessage 1L5zqFahc8Ahu9wtgJqCeJMendvD174xsG "Hi github users :p"
Output :
{
"address" : "1L5zqFahc8Ahu9wtgJqCeJMendvD174xsG",
"pubkey" : "04ef6e366cd6b0b8fbf02c0c25ad39fe892b90c597875899fdc9db16941cf43fb8c429e0534cb8b972f5cc9f1a50f36dc3352ffad427f073e1c64a145828a3be6e",
"sign" : "3046022100a80b6e0c7c54c54ba943f4e3cde12f5a7dc5313e3f0a15ce868f01683ced64fa0221008b4ad7d3800a11c241dcef7aaf44c8224a7d9f1e54d3e669bf4887036b6d10af"
}
Command : ./bitcoind verifymessage "Hi github users :p"
Output :
{
"address" : "1L5zqFahc8Ahu9wtgJqCeJMendvD174xsG",
"pubkey" : "04ef6e366cd6b0b8fbf02c0c25ad39fe892b90c597875899fdc9db16941cf43fb8c429e0534cb8b972f5cc9f1a50f36dc3352ffad427f073e1c64a145828a3be6e"
}
Reviews and comments are welcomed, I don't know if all is used as it should.
Forum thread : http://www.bitcoin.org/smf/index.php?topic=6428.0
EDIT(alex): Sipa's revision references pull 183 - #524