-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add Private Key, Public Key, Address, and Script Types #5
Comments
#11 introduced the base Address Type. |
I'm currently tinkering with the PrivateKey and PublicKey types. It makes me want to convert the KeyService class's BIP32 pieces to static extensions var rootKey = _keyService.GetRootKey(entropy);
var paymentKey = rootKey.Derive(root: true) //m
.Derive(1852) // purpose
.Derive(1815) // coin
.Derive(0) // account
.Derive(0, hardened: false) // role
.Derive(0, hardened: false); // index This also crossed my mind while beginning the refactor, im starting to think it might make more sense having a class... public class Key
{
public byte[] PrivateKey { get; set; }
public byte[] PublicKey { get; set; }
public byte[] ChainCode { get; set; }
}
//instead of
public class PrivateKey
{
public byte[] Key { get; set; }
public byte[] ChainCode { get; set; }
}
public class PublicKey
{
public byte[] Key { get; set; }
public byte[] ChainCode { get; set; }
} @tweakch thoughts? |
How about this for partial derivation var path = new WalletPath("m/1852'/1815'/0'/0/1");
var paymentKey = rootKey.Derive(path.GetSegments(depth: 4)); // zero based depth
// equivalent to
var paymentKey = rootKey.Derive(root: true) //m
.Derive(1852) // purpose
.Derive(1815) // coin
.Derive(0) // account
.Derive(0, hardened: false) // role I think
|
This inspired my comment on your PR (#17 (comment))
I like this, ill start playing around with a |
#17 introduced the |
@tweakch i believe we can close this ticket now, right? |
I believe this issue has been addressed |
We need to convert the deconstructed returns to use types.
This will help us add better developer experience
Private/Public keys need to implement CIP005 for Bech32 output format.
The text was updated successfully, but these errors were encountered: