MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.87k stars 845 forks source link

Can I neuter a HD address at multiple levels? #775

Open SwimlaneBuilder opened 4 years ago

SwimlaneBuilder commented 4 years ago

I would like to have a Bip32 address delegated so that it can send payments to services it depends on. (A cloud service that invokes sub-subscriptions)

I don't want the sub-subscriptions to be able to collude and determine they are on the same account and would like to prevent the sub sub accounts from seeing the "delegated master"?

Can I neuter an HD wallet at different levels of the hierarchy? https://programmingblockchain.gitbook.io/programmingblockchain/key_generation/bip_32

NicolasDorier commented 4 years ago

I am unsure what you mean, but basically sub account can't pass the last hardened derivation.

Imagine a common hierarchy 0'/1'/2'/3' and two sub account

0'/1'/2'/3'/1' and 0'/1'/2'/3'/2'. In this case, 1' and 2' both know they derived from 3'. If you don't like it, just add one level: 0'/1'/2'/3'/1'/1' and 0'/1'/2'/3'/2'/1'.

That said be careful with such scheme. In today's bitcoin dev, in general people use BIP44, BIP84, or BIP49 to know which hierarchy to use. You are free to choose though.