> Therefore, the input==output check is sufficient: if I use the same > set of signers for an input and an output, I can be sure that the > change goes to the same multisig wallet.
This is sufficient, in a simple case. I consider cases where spending from different wallets ('wallet compartments') can be aggregated into one transaction, for efficiency and convenience in certain circumstances. (ex: legacy addresses that cannot be abandoned due to users still sending to them, but managing them separately is inconvenient; wallet 'compartments' that each have different multisig policies and spending priorities, and change would go to most secure compartment used, etc.) This is most likely a 'borader problem', as you said, but this is just what my code already does, although with stateful signers that store trusted xpubs. I had an idea how to apply this to stateless hw wallets, and shared it. > > This would allow to distinguish the trusted output even if the > > inputs are not all derived from the same set of xpubs, that could > > happen in more complex scenarios (batching, key rotation, etc.), > > and can possibly be used to have several different types of > > 'trusted' outputs. > > This seems to be an attempt at a different, much broader problem. And > it won't help if the attacker can replay a different trusted-xpub > package (e.g., one that contains a revoked previously compromised > key). The auxiliary text can be constructed to include some code word that would mark 'epoch' of the package, and will be displayed prominently. Upon compromise, new trusted-xpub packages would use different 'epoch' code word. This is one method to make it stateless (stateful way would be to just have a counter inside hw wallet and check package version against it). _______________________________________________ bitcoin-dev mailing list bitcoin-dev@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev