Skip to content

test: evaluate captured witness OTS operations (companion to upstream #143) - #1

Draft
dinakarjs wants to merge 1 commit into
review/143-captured-packetfrom
test/nenrin-ots-operation-path
Draft

dinakarjs wants to merge 1 commit into
review/143-captured-packetfrom
test/nenrin-ots-operation-path

Conversation

@dinakarjs

Copy link
Copy Markdown
Owner

Scope and limits

Author-adoption companion to agentrust-io#143 at 04f60f8. This fork PR isolates two changed files without duplicating the author's upstream packet submission. The original author can cherry-pick the one signed commit, or this can become an upstream follow-up after agentrust-io#143 lands.

The existing packet test checks hashes and OTS metadata but does not execute the path. This adds a fixture-only reader for SHA256, append and prepend, evaluates all captured branches, and compares the Bitcoin leaf with the author-reported root at height 972264. It refuses unsupported operations, truncated/trailing data and resource limits. It is not a general OTS verifier or an authentication of a Bitcoin header, chain, witness independence or mainnet time.

Validation

Python 3.12.14 in the existing locked witness environment: five new tests pass; full unittest discovery reports 420 tests, OK; Ruff and whitespace checks pass. A changed first append operand preserves the digest header and Bitcoin attestation bytes but changes the computed root. Separate fixed-result, append-as-prepend and skip-hash mutants each cause two assertion failures and zero errors. Small independently constructed sibling branches check append/prepend/hash evaluation and branch isolation. Initial depth limit 64 rejected the captured proof; final bounded limit is 128.

References

Format semantics checked against python-opentimestamps core, especially timestamp.py, op.py and notary.py. The root comparison target comes from the packet author, not an independently authenticated header. No new dependency is introduced.

DCO

Signed-off-by: Srinivasa Dinakar Jainti dinakarjs@gmail.com

Fixture-only SHA256/append/prepend evaluator and corrupted-operand control.
No Bitcoin header authentication or mainnet time claim.

Signed-off-by: Srinivasa Dinakar Jainti <dinakarjs@gmail.com>
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