Skip to content

Don't validate clean stack for taproot prevalid, refactor. #1695

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

Merged
merged 7 commits into from
Jun 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Optimize unencumbered script version 1.
  • Loading branch information
evoskuil committed Jun 1, 2025
commit 2c7b35004ce3ff0c52be07ce54dd3b73b37dca3f
7 changes: 3 additions & 4 deletions src/chain/witness_extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,13 @@ code witness::extract_taproot(hash_cptr& out_leaf, script::cptr& out_script,
if (!control.is_valid())
return error::invalid_witness;

// The second-to-last stack element is the script.
out_script = to_shared<script>(*pop(*out_stack), false);

if (control.is_tapscript())
{
const auto& key = unsafe_array_cast<uint8_t, ec_xonly_size>(
program->data());


// The second-to-last stack element is the script.
out_script = to_shared<script>(*pop(*out_stack), false);
out_leaf = to_shared(taproot::leaf_hash(control.version(),
*out_script));

Expand Down
Loading