Skip to content
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

BIP-Taproot: Optimizing Taptree for expected Tapscript spending cost #105

Open
jachiang opened this issue Oct 19, 2019 · 4 comments
Open

Comments

@jachiang
Copy link

Regarding TapTree construction based on tapscript probability weights (e.g. Huffman):

There seems to be a privacy trade-off when optimizing for expected script path spending cost, as standard outputs will likely feature standard probability weightings, especially in protocols such as lightning. Spending a script branch will reveal its height in the tree and may imply the contract type.

If authors agree, is this worth mentioning in taproot-BIP?

@jachiang jachiang changed the title BIP-Taproot: Optimizing Taptree for expected tapscript spending cost BIP-Taproot: Optimizing Taptree for expected Tapscript spending cost Oct 19, 2019
@sipa
Copy link
Owner

sipa commented Oct 19, 2019

It seems reasonable to point out that you can add dummy branches to the Merkle tree to bring all branches to the same length, or even increase it further.

@sipa
Copy link
Owner

sipa commented Dec 12, 2019

@jachiang Feel like opening a PR for this?

@jachiang
Copy link
Author

Hi @sipa, I would be happy to do so, but have also noticed that the following has been added to the security section:

Moreover, the depth of a script in the Merkle root leaks information including the minimum depth of the tree, which suggests specific wallet software that created the output and helps clustering. Therefore, the privacy of script spends can be improved by deviating from the optimal tree determined by the probability distribution over the leaves.

I suppose dummy branches would fall under deviating from the optimal tree. Do you think we should make it explicit?

@sipa
Copy link
Owner

sipa commented Jan 14, 2020

@jachiang I don't have a very strong opinion, there is probably a lot more than can be said on the topic of constructing optimal trees (when optimal includes privacy considerations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants