-
Notifications
You must be signed in to change notification settings - Fork 282
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
wallet: support alternative signers #145
Conversation
Codecov Report
@@ Coverage Diff @@
## master #145 +/- ##
==========================================
+ Coverage 50.05% 52.96% +2.91%
==========================================
Files 126 129 +3
Lines 35403 35746 +343
Branches 5998 6026 +28
==========================================
+ Hits 17722 18934 +1212
+ Misses 17681 16812 -869
Continue to review full report at Codecov.
|
f4b6216
to
b85c2cc
Compare
What do you think about porting over the end to end tests? That would make this PR way larger and would cause a big rebase for #115, but we probably want to move them over here eventually |
I think you are right. I'll update the end-to-end tests from |
On second thought. It is probably a better idea to add sufficient unit and integration tests here. |
What do you think about passing along Lines 1749 to 1752 in af86d48
|
@boymanjor Let me know if there is anything that I can do to help get this over the finishline |
For multisig wallets that need redeem scripts to actually sign the transactions, it might be good idea to also provide redeem script within CoinView. Note that it's still possible to construct redeem scripts with this CoinView (without introducing redeem scripts in it), get wallet keys from account, and for each mapping of hash -> derivation, derive public keys for each of the accountKey + keys, resulting in redeem script. |
@tynes this is ready for another review. |
The https://github.com/handshake-org/hsd/blob/master/lib/wallet/txdb.js#L3339 |
54c6063
to
5001478
Compare
This commit includes a new class WalletCoinView and a helper class Paths. WalletCoinView inherits from CoinView and adds the ability to store HD paths on coin viewpoint objects.
This commit exposes a new 'network' argument to `toPath`. Passing the network type will generate a full HD path instead of the current, abbreviated path.
Looks good to me |
prefix += `/${purpose}'/${network.keyPrefix.coinType}'`; | ||
} | ||
|
||
return `${prefix}/${this.account}'/${this.branch}/${this.index}`; |
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.
This might be an issue whenever this.account != this.accountKey.childIndex
..
Related to: bcoin-org/bcoin#696
This PR introduces new RPC calls which create unsigned txs for each covenant type. It also adds a new WalletCoinView class that extends CoinView and stores HD paths. These paths allow alternative, HD wallets to create valid input signatures. The MTX class has also been updated to persist coin information during de/serialization. Finally, this commit adds support for unsigned auction transactions to the HTTP API.
End-to-end tests can be found in https://github.com/boymanjor/hsd-ledger and require a Ledger Nanos S hardware wallet.