Skip to content

fix(core): preserve transcript commitment order - #1179

Open
Wondertan wants to merge 1 commit into
tlsnotary:mainfrom
libid-org:fix/hash-opening-order
Open

fix(core): preserve transcript commitment order#1179
Wondertan wants to merge 1 commit into
tlsnotary:mainfrom
libid-org:fix/hash-opening-order

Conversation

@Wondertan

@Wondertan Wondertan commented Aug 28, 2026

Copy link
Copy Markdown

Summary

  • preserve transcript commitment insertion order
  • retain duplicate suppression
  • cover mixed sent/received commitments and duplicates with a regression test

Root cause

RevealOutput promises that each opening matches the input Commit by index, and SdkProver::reveal adds sent ranges followed by received ranges to the commitment builder. Before this fix, the builder stored those requests in a HashSet and emitted its arbitrary iteration order. build_reveal_output then preserves that received order within each direction without remapping by range.

With multiple commitments in one direction, callers could therefore associate an opening with the wrong plaintext range.

Tests

  • cargo test -p tlsn-core
  • cargo test -p tlsn-sdk-core --lib

The SDK correlates returned hash openings with the input Commit by index. Preserve builder insertion order while continuing to suppress duplicate commitments.

Assisted-by: GPT-5
Signed-off-by: Wondertan <hlibwondertan@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