-
Notifications
You must be signed in to change notification settings - Fork 941
Signmessage #8226
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
base: master
Are you sure you want to change the base?
Signmessage #8226
Conversation
There is a variety of signature schemes in the market. Therefore I implemented Electrum's signature scheme:
I checked against sparrow wallet and the verification succeeds.
|
In the future if it becomes necessary one could add a flag to select the signature scheme of choice. Also for reviewers: I was tempted to make hsmd sign any message fromwire, adding more flexibility in |
d291224
to
0a82edd
Compare
Electrum-style is probably the worst of the options accepted by OCEAN fwiw BIP 322 will be required if you need to support Taproot in the future. BIP 137 would be probably trivial to add here (just a version byte change) |
ec989c7
to
0024b60
Compare
a8d0e9b
to
2f7c19d
Compare
3a49a38
to
f134ed0
Compare
Tested on Ocean! |
479433d
to
cbc9205
Compare
0fcdb2a
to
ff56ac3
Compare
Changelog-Added: HSMD: add new wire API to sign messages with bitcoin wallet keys according to BIP137. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
To validate BIP137 signatures produced by core-lightning in tests. Changelog-None. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
signmessagewithkey: allows to sign a message with a key associated with one bitcoin address in our wallet. Changelog-Added: add a new rpc command signmessagewithkey to sign input messages with keys from our wallet. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
@rustyrussell: I added this last commit 721731a optionally to avoid accidentally breaking |
Add preapprove_check capabilities: WIRE_HSMD_PREAPPROVE_INCOICE_CHECK and WIRE_HSMD_PREAPPROVE_KEYSEND_CHECK to the capabilities array if dev_no_preapprove_check is not set. Do not assume those occupy the last two slots in the array. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Add a new rpc called
signmessagewithkey
that can be used to sign messages using any keyfrom our wallet. You cannot directly select the key to use, but instead you provide a bitcoin address
and the wallet will figure out which of our keys corresponds to that bitcoin address.
Solves issue #8199
TODO:
devtools/bip137-verifysignature
)