Add registration_tx unprotected header to COSE receipts#374
Add registration_tx unprotected header to COSE receipts#374
registration_tx unprotected header to COSE receipts#374Conversation
Co-authored-by: ivarprudnikov <1052642+ivarprudnikov@users.noreply.github.com>
registration_tx unprotected header to COSE receipts
| // e.g. "7.145". This allows clients to correlate a receipt with the ledger | ||
| // entry they retrieved it from. | ||
| static constexpr const char* COSE_HEADER_PARAM_REGISTRATION_TX = | ||
| "registration_tx"; |
There was a problem hiding this comment.
The registration tx is already embedded in the ccf-leaf of the receipt: https://www.ietf.org/archive/id/draft-ietf-scitt-receipts-ccf-profile-00.html#section-2.2, in the internal-evidence field (https://ccf.dev/main/use_apps/verify_tx.html#commit-evidence), and is covered by the signature/authenticated.
We should avoid introducing an un-authenticated copy of this value.
There was a problem hiding this comment.
@achamayou which CCF version will have it? At the moment we have the issue of only seeing the signature transaction which cannot be used to fetch entries or statements, I believe this was your suggestion a couple of months ago to add it via unprotected headers. There is a practical issue of linking the two together, where one is the transaction under which the entry is stored and the other is the actual signature. If you look into the transparent statement you would like to find it in the ledger, and if you were to follow signature transaction the entry will not exist there, slightly misleading, then there is an impossibility to construct a url back to the ledger from the TS, for instance to be able to log that information.
There was a problem hiding this comment.
The commit evidence has been in CCF since 2.0 I think, it's been exposed in the leaf element of the proof since we added COSE Receipts:
>>> cbor2.loads(cbor2.loads(uhdr[394][0]).value[1][396][-1][0])[1][1]
'ce:458.12440:858e0a6db787c523ac940e640a781efcd0635a5e22bdf186d46acef29759f4c1'
There was a problem hiding this comment.
I suggested that exposing a Locations list in the unprotected header for fetching is fine, because it's not an authoritative claim about the statement's content, it just says "you can fetch this again here". It can point to various caches etc if necessary.
|
Closing this. The value is already present in the vdp encoded proof but is slightly hard to read. Instead the txid will be exposed via the receipt verification result, to enforce authentication of the value before trusting it. |
Receipts returned by
/entries/{txid}and/entries/{txid}/statementcontained the CCF signing transaction ID rather than the registration transaction ID the client submitted. This made it impossible to correlate a receipt with the ledger entry used to retrieve it.Changes
app/src/cose.h— AddsCOSE_HEADER_PARAM_REGISTRATION_TX = "registration_tx"constant.app/src/main.cpp— Rewritesget_cose_receipt()to accept the entry'sregistration_txtxid and manually constructs the receipt CBOR (QCBOR) so both the inclusion proof andregistration_txland in a single unprotected header pass. BothGET /entries/{txid}andGET /entries/{txid}/statementpasshistorical_state->transaction_id.to_str().pyscitt/pyscitt/crypto.py— AddsREGISTRATION_TX = "registration_tx"constant for Python clients.test/test_verify.py— Adds unit tests covering receipt structure,cbor_to_printablerendering, and preservation throughembed_receipt_in_cose.Result
A receipt for entry
350.9219now includes:Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.