Skip to content

Conversation

@tonesnotes
Copy link
Collaborator

@tonesnotes tonesnotes commented Jun 24, 2025

PRE-REVIEW-ONLY, NOT READY TO MERGE

There is no activation mechanism, it is expected that this branch will be merged AFTER Chronicle goes live.

Status:

  1. OTDA implemented, OTDA is currently selected iff SIGHASH_FORKID is clear OR SIGHASH_CHRONICLE is set.
  2. opcodes implemented
  3. relaxed mode (malleability allowed) implemented for unlock scripts, enabled by bit 0x80000000 of version.

Remaining work:

  1. Relaxed mode linkage to OTDA described in the spec and currently implemented in bitcoin-sv-staging has not been implemented.

@tonesnotes
Copy link
Collaborator Author

Added legacyData optional boolean flag to Script.fromBinary.

Before this change, an OP_RETURN occuring in binary data being parsed for opcodes would terminate parsing, gathering all remaining bytes into a single data chunk.

After this change, an explicit second argument true must be added to renable this behavior. Otherwise fromBinary continues to parse opcodes from the bytes provided.... This is the new default behavior (no legacyData flag provided).

@tonesnotes
Copy link
Collaborator Author

All 1000 test vectors shared with bitcoin-sv for sighash preimage generation are now passing. Multiple bug fixes for both BIP143 and OTDA.

@tonesnotes
Copy link
Collaborator Author

Updated with relaxed flag only affecting unlock script, lock script is always relaxed.
Nominally implemented bit 0x80000000 for setting unlock relaxed mode from transaction version.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
10.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@F1r3Hydr4nt
Copy link
Collaborator

F1r3Hydr4nt commented Aug 9, 2025

I am assuming the following constants will be made variable:

const requireMinimalPush = true
const requirePushOnlyUnlockingScripts = true
const requireLowSSignatures = true
const requireCleanStack = true

In due course?

This is also not quite right:
https://github.com/bsv-blockchain/ts-sdk/blame/master/src/script/Spend.ts#L786

Vs: https://github.com/bitcoin-sv/bitcoin-sv/blob/86eb5e8bdf5573c3cd844a1d81bd4fb151b909e0/src/script/interpreter.cpp#L1333C41-L1334C66

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.

3 participants