Closed g-a-v-i-n closed 5 years ago
@jtobin Update: I was under the impression that wallet.owner.seed
was in fact the entropy ticket, but it is not. Sorry about that!
@jtobin Ok, finally figured this out once and for all (fingers crossed).
Since master tickets will now be included in the keygen-js output, shard()
should be a function that can be called by setting a config prop in the argument to the shard function should be an internal option set by an argument in the config passed to
fullWalletFromTicket()` and fullWalletFromSeed().
:+1: :+1:
@gavinpatkinson Is there any reason to keep fullWalletFromSeed
around?
I'm inclined to just axe it entirely, since we always want to generate wallets from tickets.
(I reckoned the easiest thing to do here was just remove it -- we can put it back in afterwards if it's needed, e.g. for internal wallet gen.)
We need a helper function that converts a wallet to a sharded wallet. I propose we add this to
keygen-js
. The output has downstream dependancies likepaper-wallet-js
.Input
1. reconstructNum Number of shards needed to reconstruct a working key or seed.
int
2. shardNum Number of shards to make.
int
3. wallet An Urbit hd wallet.
object
4. path ie: 'owner.seed', a path to the target property we want to shard.
string
Output
A full wallet, where the the target is transformed from a
string
to andarray of strings
Usage
To make this easy we can use lodash's
get
andset
which accept string object property paths. This means adding lodash as a dep.Other ideas:
shard()
could accept a full wallet with theowner.seed
path built in. IMO not ideal because it is overly specific.or only a value to shard.
This isn't exactly ideal because it means the wallet has to be manually reconstructed.