Skip to content

fix(receipts): fix #58 by binding receipts to payload commitments#315

Merged
kryputh merged 1 commit into
Stellar-Mail:mainfrom
Dopezapha:feature-58-bind-receipts-payload-commitments
Jun 17, 2026
Merged

fix(receipts): fix #58 by binding receipts to payload commitments#315
kryputh merged 1 commit into
Stellar-Mail:mainfrom
Dopezapha:feature-58-bind-receipts-payload-commitments

Conversation

@Dopezapha

Copy link
Copy Markdown
Contributor

Closes #58

PR Description

This PR fixes issue #58 by binding delivery receipts to encrypted payload commitments in the Soroban receipts contract.

Before this change, a receipt was keyed by message_id and stored sender, recipient, delivery time, and optional read time. That proved a message ID had a receipt, but it did not prove which encrypted payload the receipt referred to.

The delivery flow now records the message ID, payload hash, protocol version, sender, recipient, delivery timestamp, and optional read timestamp in the receipt state. The sender authorizes the delivery record with those commitment fields as part of the contract call. Once a receipt exists for a message ID, the contract rejects any attempt to reuse that ID with a different payload hash, protocol version, sender, or recipient. Reusing the same commitment also fails, so receipt state cannot be overwritten.

The read flow remains recipient-controlled. read(message_id) loads the existing receipt, requires authorization from the stored recipient, and only adds read_at; it does not change the payload commitment. A third party can call get(message_id) to verify receipt consistency against the known payload hash without seeing message content.

Changes Made

@kryputh kryputh merged commit 4a958f8 into Stellar-Mail:main Jun 17, 2026
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.

contracts: bind delivery receipts to encrypted payload commitments

2 participants