0

I'm looking at the following official test vector:

wsh(multi(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))

which is serialized for the first key as:

04 ; version 4
88b21e ; `xpub`
00 ; depth 0 == public key of a master key
00000000 ; parent fingerprint
00000000 ; child index
60499f801b896d83179a4374aeb7822aaeaceaa0db1f85ee3e904c4defbd9689 ; chain code
03cbcaa9c98c877a26977d00825c956a238e8dddfbd322cce4f74b0b5bd6ace4a7 ; key data
e233a252 ; base58 checksum

and the second key:

04 ; version 4
88b21e ; `xpub`
01 ; depth 1
bd16bee5 ; parent fingerprint
00000000 ; child index
f0909affaa7ee7abe5dd4e100598d4dc53cd709d5a5c2cac40e7412f232f7c9c ; chain code
02fc9e5af0ac8d9b3cecfe2a888e2117ba3d089d8585886c9c826b6b22a98d12ea ; key data
44183bfc ; base58 checksum
  1. My question is for example for the second key: is the depth connected with the appended tail /0/0/*? If it is, shouldn't it be 2 instead of 1? Can depth be restored from the appended tail?

  2. Why is the child index zero for the second key? Should it not be equal to the number that corresponds to the star. Can a child index be restored from the appended tail /0/0/*?

1 Answer 1

0

It looks like you are confusing the BIP 32 serialization with output descriptor serialization.

Output descriptors contain an extended public key serialized using the method described in BIP 32. This serialization applies only to that particular public key. The derivation appended to the end is independent and separate from that xpub's serialization. That is part of descriptors.

  1. My question is for example for the second key: is the depth connected with the appended tail /0/0/*? If it is, shouldn't it be 2 instead of 1? Can depth be restored from the appended tail?

No. The tail is independent from the xpub. The depth applies only to the pubkey serialized by the xpub, which the derivation path is not a part of.

  1. Why is the child index zero for the second key? Should it not be equal to the number that corresponds to the star. Can a child index be restored from the appended tail /0/0/*?

Because the serialization is only for that particular xpub. The appended derivation information is not part of this serialization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.