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
Add Script:dust_value() to get minimum output value for a spk #566
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When looking at core it also captures the case where a script is too big making the UTXO unspendable. But that would only make this implementation more conservative which might be ok since it's such a fringe use case and not consensus critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, right - are those scripts broadcastable at all or are they nonstandard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those scripts are not possible by consensus rules all scripts(bare, p2sh, witness_v0). But post tapscript, those scripts will be broadcastable.https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#resource-limitshttps://github.com/bitcoin/bitcoin/blob/6c6140846f37de8c132b3b6abf09f3d7940554a7/src/script/interpreter.cpp#L452We can change the isWitnessProgram check to check only v0 programs, but this can also be done in taproot upgrade #503. But this could have easily been one of the things we forgot to add.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgeisler Nevermind, I was wrong. This function is about scriptPubkey and not about the witness Program inside it. The witness program can be more 10,000 in Tapscript, but scriptpubkey is always 35.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'm not even talking about if its valid (its obviously not possible to spend), but is it standard - can you broadcast a transaction with such a script in an output and have it be mined, even if the output is unspendable.