canton-explicit-disclosure
Canton Explicit Contract Disclosure
Overview
In Daml, visibility is set by stakeholder annotations — normally you'd recreate a contract to change who sees it. Explicit contract disclosure instead delegates read rights to non-stakeholders off-ledger, so a party can use a contract it doesn't own as a transaction input. This is efficient, scalable data sharing (it's on by default; disable with participants.participant.ledger-api.enable-explicit-disclosure = false).
Why it exists — e.g. serve stock prices via a normal Web2 API and feed only the current price back into the ledger at the moment of use (instead of subscribing to thousands of updates), while keeping the same validation/security. It's the mechanism behind the Token Standard's disclosedContracts (canton-token-standard).
Read delegation
A party can acquire read rights during command submission over a contract where it's neither stakeholder nor informee — by attaching the contract to the command. Example: a Buyer exercises Offer_Accept on a Seller's Offer and must reference a Stock and a PriceQuotation it can't see. Without disclosure the submission fails citing missing visibility; with disclosure the Buyer attaches those contracts.
Disclosure bypasses visibility, not authorization: the command must still be well-authorized — actors must be properly authorized for the action.
The DisclosedContract
A stakeholder fetches the contract's CreatedEvent from the Ledger API and shares it off-ledger (HTTPS/SFTP/email). A DisclosedContract is built from three fields of that event:
template_id— the contract's template idcontract_id— the contract idcreated_event_blob— opaque blob encoding the contract
The
created_event_blobis populated only on demand: request it withincludeCreatedEventBlob: trueonGetActiveContracts/GetUpdates/GetUpdateTrees(the same flag the Token Standard'sInterfaceFilteruses). Only contracts created from Canton 2.8+ can be disclosed.