-
Notifications
You must be signed in to change notification settings - Fork 276
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
Sign & verify message with name #609
Conversation
Pull Request Test Coverage Report for Build 922544001
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on this dude! Very cool and fun to play with on command line as well:
--> hsw-rpc signmessagewithname test-txt "Falci is handsome."
CUjgakQfpOG9aTa4DzKaX9heuYZW2D26tZ9pb6VEgco5pLNuU8NljSQn2DtAFGkpEiEugNYNh94W7JZAjKuWkQ==
--> hsd-rpc verifymessagewithname test-txt CUjgakQfpOG9aTa4DzKaX9heuYZW2D26tZ9pb6VEgco5pLNuU8NljSQn2DtAFGkpEiEugNYNh94W7JZAjKuWkQ== "Falci is handsome."
true
--> hsd-rpc verifymessagewithname test-txt CUjgakQfpOG9aTa4DzKaX9heuYZW2D26tZ9pb6VEgco5pLNuU8NljSQn2DtAFGkpEiEugNYNh94W7JZAjKuWkQ== "Falci is not handsome."
false
Oh one more thing: please add these new RPC methods to the CHANGELOG! |
As discussed, both sign and verify should check if name is
|
lib/node/rpc.js
Outdated
} | ||
|
||
const address = coin.address.toString(this.network); | ||
return this.verifyMessage([address, sig, str], help); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to pass help
here. If help were true
, we'd throw an error right away, and we don't want to return help from a different RPC call anyway. Applies to both functions.
lib/wallet/rpc.js
Outdated
if (!wallet.master.key) | ||
throw new RPCError(errs.WALLET_UNLOCK_NEEDED, 'Wallet is locked.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this here, it will be checked in signMessage()
and we don't need to decrypt the wallet until then anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f1e096f
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK f1e096ff1faa7b9ee56415f37e5fe55286ec3a55
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmDBDOAACgkQ5+KYS2KJ
yTox3xAAqMLyvBNxI0MCIy8W2JwLFAOM5FsbC6kf7GQ9zO7rgYPjUWtIBIg8ECW0
vYd/kPlXU0I86hDYEGnUtwW3P6uX+SERhR6AVPW+mbxPJlT2MZ7LfzAMXAXLxfTV
umm6fzWsHXUj9H59FZX3eFkGpZ6fcofZck4/5NMsaiHBffZLbeP/uQN8sFC1NTEw
c1orML4rrstolIX9km9AZoOkecZXl0eRmEg9HMPlSpNnZHFokW8TFgpDvlqPQC0g
2zfPvTHtISSyULwEsAuwq4464ad9ZZLpppFx3lED22SW1d5IxqwjHH4iSqC9L4zp
f45CoDsbbOoocbCAyMwuPRg7QaiDeLYxdR1ijIc3AlKmHHSUPzOM1xU6e3vt/pxt
5/ZtwAKHwzcfSh/l9aUXvDXuEt0L1v+ra5lfUzr6MKtICdCrNsoJxHIXq4uBI1JP
Td03E5xH5b80xEZt3YwupliN/2ShSRYc+8RieZSLLB+9GhpWwMSM/pE2IUT1vWnX
tyhvdL//ledI/eRHwdoeZ9aYQsiRJz/5H9xXoP1q3RfQ+rYWUWf2yXtqDRJ6Gc1I
dPcnpdkK6hfDTQn/41FRnQFWQ9ueZFHMXZWtRPP07sfSd5alrYCqWeP6Q7IG588E
N+nYe/ZWvn6xWksJ2iW5stUNyK9hdVoF8SLlhqVHXATcmAXo3DQ=
=dTW7
-----END PGP SIGNATURE-----
pinheadmz's public key is on keybase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx!
#606 item 2: Create new RPCs
signmessagewithname
andverifymessagewithname