Skip to content

Testing current master with lethekit #5

Open

Description

@gorazdko

Abstract

Testing 7604c80

Test vector 1

seed_lethekit=$(seedtool --in ur ur:crypto-seed/oyadgdvlpfssfwmkztcebbnyzowkspnljlrhdkztykahhf)

keytool \
    --seed $seed_lethekit \
    --address-index '*' \
    output-descriptor

result OK, matches with lethekit:

wpkh([b238a845/84h/0h/0h]xpub6D1GQL3S3qryEx5gQccdVB5Fy1ePkeDGU8bMmW1GKfDQvtBsbJ6FaaudsBphw2WwtjYyJ4ARR6Mh9ZRTTKqro6eZww2m6SVxG7WuY2DALVp/0/*)

descriptor_wpkh

Test vector 2

# address wpkh not supported only pkh and sh?
for (( i=0; i <= 9; ++i ))
do
    keytool \
    	--seed 1eb5338edac6fae54cbb172091ae6c1a \
    	--address-index $i \
    	address-index \
    	full-address-derivation-path \
    	address-pkh
done

Result:

0
c1859926/84h/0h/0h/0/0
17u4HStkGWxJ5PtNqzCMEKRzaPJ8h35eBc
1
c1859926/84h/0h/0h/0/1
1JyxrbHYS7ZGhq68JewhJAMWka38Bv8tFw
2

Here I noticed no support for segwit addresses? Also, the output shows segwit derivation path (84h) when address-pkh specified (44h) -> Not OK.


You can generate more test vectors for a particular seed (e.g. lethekit_seed/mnemonic: together mail awful cradle scrub apart hip leader silk slice unusual embark) in https://iancoleman.io/bip39/

Activity

  1. wolfmcnally commented on Mar 4, 2021

    @wolfmcnally
    Collaborator

    @gorazdko I think I had some previous conversations with @ChristopherA and/or @Fonta1n3 where they thought the best default value for the purpose path component was 84. Please advise.

  2. ChristopherA commented on Mar 4, 2021

    @ChristopherA
    Contributor

    @wolfmcnally I think that came from the discussion that if the output is a complete descriptor (which is what keytool-cli does), and as LetheKit can only do single signature, the default should be 84' crypto-hdkey as that is segwit or its SLIP-132 form of zpub/zprv (I hate SLIP-132, but as future Gordian will not be supporting singlesig except to sweep, and that is what Ledger/Trezor use for segwit, we have to continue to offer it as an option.)

    However, we want to focus with LetheKit export not of descriptors but of the crypto-hdkey that is a cosigner, i.e. [48'/0'/0'/2']xpub… and the cosigner's private key [48'/0'/0'/2']xprv….  These two should be the minimal number of clicks, then the singlesig segwit zpub/zprv, then everything else can have more manual entry steps in LetheKit.

    Similarly, we need these in seedtool to be the defaults. If you ask for descriptor and don't define a path, it defaults to /84'/0'/0'/0'. If you ask for SLIP-132 and don't offer path offers zpub/zprv form, if you ask for hdkey and don't define path, you get [48'/0'/0'/2']xpub….

  3. gorazdko commented on Mar 4, 2021

    @gorazdko
    ContributorAuthor

    I think I had some previous conversations with @ChristopherA and/or @Fonta1n3 where they thought the best default value for the purpose path component was 84. Please advise.

    Yes I agree 84 to be default, but there are flags that should change the default value of purpose. Just like here where you made purpose dependent on output-type.

    The flags that should change the default purpose are those which hold values: pkh, wpkh, sh-wpkh

    The result I pasted above:

    c1859926/84h/0h/0h/0/0
    17u4HStkGWxJ5PtNqzCMEKRzaPJ8h35eBc

    is not wrong, it looks weird though, because 84h is standard for segwit addresses (bech32) and 44h is standard for pkh addresses (base58check)

    @wolfmcnally also please test my lethekit PR with keytool and Guardian to confirm that my implementation of cosigner is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions