Packages

package protocol

Provides shorthands for general purpose types.

Most notably, it provides a facade for Daml-LF transactions and nodes. By default, code should access Daml-LF transaction and nodes types through this facade.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. protocol
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package messages

    This package contains data structures used in the transaction protocol.

    This package contains data structures used in the transaction protocol. However, generic data structures, e.g. com.digitalasset.canton.data.MerkleTree etc. are kept in com.digitalasset.canton.data package.

  2. package v0
  3. package version

Type Members

  1. trait AlarmStreamer extends AnyRef

    AlarmStreamer is responsible for streaming alarms, which are events that signal abnormal system operation as described in: https://engineering.da-int.net/docs/platform-architecture-handbook/arch/ledger-sync/api.html?highlight=alarm#alarms-stream

  2. sealed trait ConfirmationPolicy extends Product with Serializable with PrettyPrinting
  3. case class ContractMetadata extends HasVersionedWrapper[VersionedContractMetadata] with HasProtoV0[Metadata] with PrettyPrinting with Product with Serializable

    Metadata for a contract.

    Metadata for a contract.

    Exceptions thrown

    ContractMetadata.InvalidContractMetadata if some maintainers are not signatories or some signatories are not stakeholders.

  4. final case class ContractSalt(unwrap: Salt) extends AnyVal with Product with Serializable

    A blinded cryptographic hash of the information that ensures uniqueness of Unicums in Canton.

    A blinded cryptographic hash of the information that ensures uniqueness of Unicums in Canton. The hash can be used to unblind the Unicum's cryptographic commitment to the contract data.

    See also

    UnicumGenerator for the construction details

  5. case class CreatedContract extends HasProtoV0[protocol.v0.ViewParticipantData.CreatedContract] with NoCopy with PrettyPrinting with Product with Serializable
  6. case class DomainParameters(participantResponseTimeout: NonNegativeFiniteDuration, mediatorReactionTimeout: NonNegativeFiniteDuration, heartbeatInterval: Option[NonNegativeFiniteDuration], ledgerTimeRecordTimeTolerance: NonNegativeFiniteDuration, transferExclusivityTimeout: NonNegativeFiniteDuration, reconciliationInterval: NonNegativeFiniteDuration, maxRatePerParticipant: NonNegativeInt, maxInboundMessageSize: NonNegativeInt, uniqueContractKeys: Boolean, mediatorHeartbeatInterval: NonNegativeFiniteDuration, mediatorInactivityTolerance: NonNegativeFiniteDuration, requiredSigningKeySchemes: NonEmptySet[SigningKeyScheme], requiredEncryptionKeySchemes: NonEmptySet[EncryptionKeyScheme], requiredSymmetricKeySchemes: NonEmptySet[SymmetricKeyScheme], requiredHashAlgorithms: NonEmptySet[HashAlgorithm], requiredCryptoKeyFormats: NonEmptySet[CryptoKeyFormat]) extends HasVersionedWrapper[VersionedDomainParameters] with HasProtoV0[protocol.v0.DomainParameters] with Product with Serializable

    Domain parameters that all members connecting to a domain must adhere to.

    Domain parameters that all members connecting to a domain must adhere to.

    This is the protocol message that is send to all members when they connect to a domain. The parameters in the domain node are configured using DomainParametersConfig.

  7. case class InputContract(contract: SerializableContract, consumed: Boolean) extends HasProtoV0[protocol.v0.ViewParticipantData.InputContract] with PrettyPrinting with Product with Serializable
  8. type LfActionNode = GenActionNode[LfNodeId, LfContractId]

    Shorthand for Daml-LF "action" nodes (all node types besides "rollback" nodes)

  9. type LfActionNodeWithoutChildren = GenActionNode[Nothing, LfContractId]
  10. type LfChoiceName = Name
  11. type LfCommittedTransaction = T
  12. type LfContractId = daml.lf.value.Value.ContractId

    Shorthand for Daml-LF contract ids

  13. type LfContractIdString = ContractIdString

    Shorthand for Daml-LF contract id strings that Daml-LF contract ids are based on

  14. type LfContractInst = ContractInst[VersionedValue[LfContractId]]

    Shorthand for contract instances.

  15. type LfContractInstUnversioned = ContractInst[Value[LfContractId]]
  16. type LfGlobalKey = GlobalKey

    Shorthand for global contract keys (with template_id).

  17. type LfGlobalKeyWithMaintainers = GlobalKeyWithMaintainers
  18. type LfHash = Hash
  19. type LfKeyWithMaintainers = KeyWithMaintainers[Value[LfContractId]]

    Shorthand for contract keys ("local" within an lf transaction node).

  20. type LfLeafOnlyActionNode = LeafOnlyActionNode[LfContractId]

    Shorthand for leaf only action nodes.

  21. type LfNode = GenNode[LfNodeId, LfContractId]

    Shorthand for Daml-LF nodes.

    Shorthand for Daml-LF nodes. Nodes include NodeIds of their children. Children need to be looked up in the underlying transaction.

  22. type LfNodeCreate = NodeCreate[LfContractId]

    Shorthand for create nodes.

  23. type LfNodeExercises = NodeExercises[LfNodeId, LfContractId]

    Shorthand for exercise nodes.

    Shorthand for exercise nodes. Nodes include NodeIds of their children. Children need to be looked up in the underlying transaction.

  24. type LfNodeExercisesWithoutChildren = NodeExercises[Nothing, LfContractId]

    Shorthand for exercise nodes.

    Shorthand for exercise nodes. Nodes cannot have children, as the Nid parameter is defined as Nothing.

  25. type LfNodeFetch = NodeFetch[LfContractId]

    Shorthand for fetch nodes.

  26. type LfNodeId = NodeId
  27. type LfNodeLookupByKey = NodeLookupByKey[LfContractId]

    Shorthand for lookup by key nodes.

  28. type LfNodeRollback = NodeRollback[LfNodeId]

    Shorthand for rollback nodes.

  29. type LfNodeWithoutChildren = GenNode[Nothing, LfContractId]

    Shorthand for Daml-LF nodes.

    Shorthand for Daml-LF nodes. Nodes cannot have children, as the Nid parameter is defined as Nothing.

  30. type LfSubmittedTransaction = T
  31. type LfTemplateId = Identifier
  32. type LfTransaction = GenTransaction[LfNodeId, LfContractId]

    Shorthand for Daml-LF transaction wrapped in versioned transaction in turn wrapped in committed or submitted transaction

  33. type LfTransactionVersion = TransactionVersion
  34. type LfVersionedTransaction = VersionedTransaction[LfNodeId, LfContractId]
  35. class LoggingAlarmStreamer extends AlarmStreamer
  36. case class MalformedContractId(id: String, message: String) extends Product with Serializable
  37. case class MediatorUid(str: String36) extends LengthLimitedStringWrapper with Product with Serializable

    Unique identifier for a mediator

  38. case class PackageDescription(packageId: PackageId, sourceDescription: String) extends Product with Serializable

    packageId

    the unique identifier for the package

    sourceDescription

    an informal human readable description of what the package contains

  39. trait PackageInfoService extends AnyRef
  40. trait Phase37Processor[RequestBatch] extends AnyRef
  41. case class RequestAndRootHashMessage[RequestEnvelope](requestEnvelopes: NonEmptyList[RequestEnvelope], rootHashMessage: RootHashMessage[SerializedRootHashMessagePayload]) extends Product with Serializable
  42. case class RequestId(ts: CantonTimestamp) extends PrettyPrinting with Product with Serializable

    A confirmation request is identified by the sequencer timestamp.

  43. type RequestProcessor[VT <: ViewType] = Phase37Processor[RequestAndRootHashMessage[OpenEnvelope[EncryptedViewMessage[VT]]]]
  44. case class ResolvedKey(key: LfGlobalKey, resolution: KeyResolution) extends HasProtoV0[protocol.v0.ViewParticipantData.ResolvedKey] with Product with Serializable
  45. case class RollbackContext extends HasProtoV0[protocol.v0.ViewParticipantData.RollbackContext] with NoCopy with PrettyPrinting with Product with Serializable

    RollbackContext tracks the location of lf transaction nodes or canton participant views within a hierarchy of LfNodeRollback suitable for maintaining the local position within the hierarchy of rollback nodes when iterating over a transaction.

  46. case class RootHash(hash: Hash) extends PrettyPrinting with HasCryptographicEvidence with Product with Serializable

    The root hash of a Merkle tree used as an identifier for requests.

    The root hash of a Merkle tree used as an identifier for requests.

    Extends com.digitalasset.canton.serialization.HasCryptographicEvidence so that RootHash's serialization can be used to compute the hash of an inner Merkle node from its children using RootHash.getCryptographicEvidence. Serialization to Protobuf fields can be done with RootHash.toProtoPrimitive

  47. case class SerializableContract(contractId: LfContractId, rawContractInstance: SerializableRawContractInstance, metadata: ContractMetadata, ledgerCreateTime: CantonTimestamp) extends HasVersionedWrapper[VersionedSerializableContract] with HasProtoV0[protocol.v0.SerializableContract] with PrettyPrinting with Product with Serializable

    Represents a serializable contract.

    Represents a serializable contract.

    contractId

    The ID of the contract.

    rawContractInstance

    The raw instance of the contract.

    metadata

    The metadata with stakeholders and signatories; can be computed from contract instance

    ledgerCreateTime

    The ledger time of the transaction creating the contract

  48. case class SerializableContractWithWitnesses(contract: SerializableContract, witnesses: Set[PartyId]) extends Product with Serializable

    Serializable contract with witnesses for contract add/import used in admin repairs.

    Serializable contract with witnesses for contract add/import used in admin repairs.

    contract

    serializable contract

    witnesses

    optional witnesses that observe the creation of the contract

  49. case class SerializableRawContractInstance extends MemoizedEvidenceWithFailure[EncodeError] with Product with Serializable

    Represents a serializable contract instance and memoizes the serialization.

  50. case class TransactionId(hash: Hash) extends HasCryptographicEvidence with Product with Serializable

    A hash-based transaction id.

  51. case class TransactionMetadata(ledgerTime: CantonTimestamp, submissionTime: CantonTimestamp, seeds: Map[LfNodeId, LfHash]) extends Product with Serializable

    Collects the metadata of a LF transaction to the extent that is needed in Canton

    Collects the metadata of a LF transaction to the extent that is needed in Canton

    ledgerTime

    The ledger time of the transaction

    submissionTime

    The submission time of the transaction

    seeds

    The node seeds by node ID

  52. case class TransferId(originDomain: DomainId, requestTimestamp: CantonTimestamp) extends PrettyPrinting with HasProtoV0[protocol.v0.TransferId] with Product with Serializable

    A transfer is identified by the origin domain and the sequencer timestamp on the transfer-out request.

  53. final case class Unicum(unwrap: Hash) extends AnyVal with Product with Serializable

    A hash-based identifier for contracts.

    A hash-based identifier for contracts. Must be paired with a discriminator to obtain a complete contract ID.

  54. class UnicumGenerator extends AnyRef

    Generates Unicums for contract IDs such that the Unicum is a cryptographic commitment to the following:

    Generates Unicums for contract IDs such that the Unicum is a cryptographic commitment to the following:

    • The DomainId of the transaction that creates the contract
    • The UUID of the transaction that creates the contract
    • The com.digitalasset.canton.data.ViewPosition of the view whose core creates the contract
    • The index of the create node within the view
    • The ledger time when the contract was created
    • The template ID and the template arguments of the contract, including the agreement text

    The commitment is implemented as a blinded hash with the view action salt as the blinding factor.

    The above data is split into two groups:

    The Unicum is then the cryptographic hash of the ContractSalt and the second group.

    The ContractSalt contains all the information that ensures uniqueness of contract IDs in Canton. The second group contains the information that is relevant for using the contract in transactions. The commitment to the information in the second group can be opened by revealing the ContractSalt. Since the ContractSalt is a blinded hash, such an opening does not reveal information about the data in the first group.

    Properties

    • If a transaction is added to the virtual domain ledger for a given domain, then the [[Unicum]] is globally unique unless a hash collision occurs.
      Contracts with the same Unicum must run over the same domain and have the same transaction UUID. The definition of the virtual domain ledger ensures that transaction UUIDs are unique within the com.daml.api.util.LedgerEffectiveTimeTolerance and that the sequencing time deviates from the ledger time by at most this tolerance. So two contracts with the same Unicum must be generated by the same transaction. However, the com.digitalasset.canton.data.ViewPosition and the create index uniquely identify the node in the transaction that creates the contract.
    • If the submitter is honest and chooses a random transaction seed, the [[Unicum]] does not leak information about template arguments.
      The transaction seed's randomness propagates to the action seed through the seed derivation scheme. Since the honest submitter does not leak the transaction seed and shows the action seed only to the witnesses of the view, the ContractSalt looks random to non-witnesses of the view. Accordingly, the ContractSalt blinds the template arguments.
    • The [[Unicum]] authenticates the contract details (ledger time and template arguments) if the hash function is preimage resistant.
      By checking the hash of the ContractSalt and the contract details against the Unicum, everyone can verify that they fit together. As the hash function is preimage resistant, it is therefore computationally infeasible for a participant to find a different ContractSalt such that different contract details lead to the same hash.
    • Participants learning about the contract only through divulgence or disclosure do not learn in which transaction the contract was created unless the submitter or witnesses of the creation leak this information.
      By the honesty assumption, the action seed is a random value to those participants. Accordingly, since the ContractSalt contains all the information that ties the contract to a particular transaction, the participants cannot say which transaction with the same ledger time created the contract.
    • The [[Unicum]] does not leak the contract details when a contract ID is shown to a third party if the submitter and all witnesses and divulgees are honest.
      By the honesty assumption, the action seed is a random value to the third party, and so is the ContractSalt. This entropy hides the contract details to the third party.
  55. case class ViewHash(hash: Hash) extends PrettyPrinting with Product with Serializable

    A hash-based transaction view id

    A hash-based transaction view id

    Views from different requests may have the same view hash.

  56. case class WellFormedTransaction[+S <: State] extends NoCopy with Product with Serializable

    Used to mark a transaction to be well-formed.

    Used to mark a transaction to be well-formed. That means:

    • tx is well-formed according to the Daml-LF definition, i.e., a root node is not child of another node and every non-root node has exactly one parent and is reachable from a root node. (No cycles, no sharing, no orphaned node).
    • All node Ids are non-negative.
    • The type parameter S determines whether all create nodes have suffixed IDs or none.
    • Create nodes have unique contract ids of shape com.daml.lf.value.Value.ContractId.V1. The contract id of a create node is not referenced before the node. The contract id of a rolled back create node is not referenced outside its rollback scope.
    • The discriminators of create nodes without suffixed contract ids are unique among all discriminators that appear in the transaction.
    • Every action node has at least one signatory.
    • Every signatory is also a stakeholder.
    • Fetch actors are defined.
    • All created contract instances and choice arguments in the transaction can be serialized.
    • All nodes in the transaction have the optLocation field set to None.
    • metadata contains seeds exactly for those node IDs from tx that should have a seed (creates and exercises).
    • Keys of transaction nodes don't contain contract IDs.
    • The maintainers of keys are non-empty.
    • ByKey nodes have a key.
    • All parties referenced by the transaction can be converted to com.digitalasset.canton.identity.PartyId
    • The transaction has the optUsedPackages set to scala.None$
    • Every rollback node has at least one child and no rollback node appears at the root unless the transaction has been merged by Canton.
  57. case class WithContractHash[+A](x: A, contractHash: LfHash) extends Product with Serializable
  58. case class WithContractMetadata[+A](x: A, metadata: ContractMetadata) extends Product with Serializable
  59. case class WithRollbackScope[T](rbScope: RollbackScope, unwrap: T) extends Product with Serializable
  60. case class WithTransactionId[+A](x: A, transactionId: TransactionId) extends Product with Serializable

Value Members

  1. val LfActionNode: GenActionNode.type
  2. val LfChoiceName: ChoiceName.type
  3. val LfCommittedTransaction: CommittedTransaction.type
  4. val LfContractId: daml.lf.value.Value.ContractId.type
  5. val LfContractIdString: ContractIdString.type
  6. val LfContractInst: ContractInst.type
  7. val LfContractInstUnversioned: ContractInst.type
  8. val LfGlobalKey: GlobalKey.type
  9. val LfGlobalKeyWithMaintainers: GlobalKeyWithMaintainers.type
  10. val LfHash: Hash.type
  11. val LfKeyWithMaintainers: KeyWithMaintainers.type
  12. val LfNode: GenNode.type
  13. val LfNodeCreate: NodeCreate.type
  14. val LfNodeExercises: NodeExercises.type
  15. val LfNodeFetch: NodeFetch.type
  16. val LfNodeId: NodeId.type
  17. val LfNodeLookupByKey: NodeLookupByKey.type
  18. val LfNodeRollback: NodeRollback.type
  19. val LfSubmittedTransaction: SubmittedTransaction.type
  20. val LfTemplateId: TypeConName.type
  21. val LfTransaction: daml.lf.CantonOnly.LfTransaction.type
  22. val LfTransactionVersion: TransactionVersion.type
  23. val LfVersionedTransaction: VersionedTransaction.type
  24. object ConfirmationPolicy extends Serializable
  25. object ContractId
  26. object ContractIdSyntax
  27. object ContractMetadata extends HasVersionedWrapperCompanion[VersionedContractMetadata, ContractMetadata] with Serializable
  28. object ContractSalt extends Serializable
  29. object CreatedContract extends Serializable
  30. object DomainParameters extends HasVersionedWrapperCompanion[VersionedDomainParameters, DomainParameters] with Serializable
  31. object GlobalKeySerialization
  32. object InputContract extends Serializable
  33. object LfHashSyntax
  34. object MediatorUid extends LengthLimitedStringWrapperCompanion[String36, MediatorUid] with Serializable
  35. object PackageDescription extends Serializable
  36. object RequestId extends Serializable
  37. object ResolvedKey extends Serializable
  38. object RollbackContext extends Serializable
  39. object RootHash extends Serializable
  40. object SerializableContract extends HasVersionedWrapperCompanion[VersionedSerializableContract, SerializableContract] with Serializable
  41. object SerializableRawContractInstance extends Serializable
  42. object TransactionId extends Serializable
  43. object TransactionMetadata extends Serializable
  44. object TransferId extends Serializable
  45. object ViewHash extends Serializable
  46. object WellFormedTransaction extends Serializable
  47. object WithContractHash extends Serializable
  48. object WithContractMetadata extends Serializable
  49. object WithTransactionId extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped