-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: sign message #546
feat: sign message #546
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #546 +/- ##
===========================================
+ Coverage 62.64% 77.94% +15.29%
===========================================
Files 67 67
Lines 5209 5227 +18
Branches 1103 1103
===========================================
+ Hits 3263 4074 +811
+ Misses 1853 1142 -711
+ Partials 93 11 -82
|
8df821d
to
65a3d41
Compare
65a3d41
to
b6b38d2
Compare
import { IEncryptedData } from '../types'; | ||
|
||
// Monkey-patch MAGIC_BYTES to use Hathor's | ||
bitcore.Message.MAGIC_BYTES = Buffer.from(HATHOR_MAGIC_BYTES); |
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.
Do we use this Message
class from bitcore for anything in the wallet service facade here in the lib?
I remember we were using it in the wallet service code before changing the library there.
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.
We do use bitcore-message
to prove we own the xpub
and the authXpub
in wallet-service here
We can and probably should use the new utils/crypto.ts
method, but I suggest we don't refactor it in this PR as we also need to change wallet-service to expect Hathor Signed Message\n
instead of Bitcoin Signed Message\n
it currently expect.
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.
We can and probably should use the new utils/crypto.ts method, but I suggest we don't refactor it in this PR as we also need to change wallet-service to expect Hathor Signed Message\n instead of Bitcoin Signed Message\n it currently expect.
That's my main concern. If we changed the magic bytes for the lib, the current wallets we have in the wallet service wouldn't work anymore, right? Because they were generated using the old magic bytes, or not?
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 checked and this is indeed a problem, since we are monkey patching the Message class, it will affect the signMessage for the wallet-service.
I will merge this and work on a fix on the wallet-service side
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.
e1de545
to
16ff17e
Compare
2ca2840
to
d751ac0
Compare
d751ac0
to
b8d00ff
Compare
Acceptance Criteria
signMessageWIthAddress
method on both facadesSecurity Checklist