Skip to content

Conversation

@sander2
Copy link

@sander2 sander2 commented Jan 6, 2026

Fixes script evaluation for taproot scripts that contain op_codeseparator. Before this pr, opcode_count was not incremented for taproot scripts. On top of that, the behavior of op_codeseparator changed in BIP342 compared to non-taproot scripts:

codesep_pos (4): the opcode position of the last executed OP_CODESEPARATOR before the currently executed signature opcode, with the value in little endian (or 0xffffffff if none executed). The first opcode in a script has a position of 0. A multi-byte push opcode is counted as one opcode, regardless of the size of data being pushed. Opcodes in parsed but unexecuted branches count towards this value as well.

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

Successfully merging this pull request may close these issues.

1 participant