States
NextNotaryInfoId
The NextNotaryInfoId is a global counter for the notary info id. It increments by 1 for each notary info registered by
decentralised applications.
NotaryInfoMap
The mapping of the notary info object to the notary info id. The NotaryInfo is given as:
// The verifier contract type to be stored in the module
message NotaryInfo {
  // The address used to create this object and can be used to update it
  string notary_info_admin = 1
    [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
  // Notarised Asset ID: type of asset
  uint64 notarised_asset_id = 2;
  // Caller Tx ExtensionOption VP Route and additional request parameters in AnteHandler
  d.vcv.v1.RouteAndAdditionalReq caller_route_and_additional_req = 3;
  // Asset Route and additional request params
  d.vcv.v1.RouteAndAdditionalReq asset_route_and_additional_req = 4;
}
AssetTypeMap
Maps asset type IDs to their string representations, allowing for categorization and identification of different asset types that can be notarised through the system.
NotarisedAssets
A mapping from asset identifiers (typically DIDs like did:dchain:notary:assetid) to their corresponding
NotarisedAsset objects. The asset identifier is calculated as the SHA hash of the input asset data and is expected to
be included in the additional requirements during verification.
// Notarised Asset wrapper that can contain different asset types
message NotarisedAsset {
  oneof asset {
    AssetInvoice asset_invoice = 1;
    // Additional asset types can be added here
  }
}
AssetInvoice and AssetInvoiceData
The stored states of AssetInvoice is the post processed data from the input AssetInvoiceData.
// Stored state of NotarisedAsset for Invoice type
message AssetInvoice {
  string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
  // The status of the asset,
  // Init: NOTARISED
  Status status = 2;
  // odp hash
  string odp_hash = 3;
  // issuance ID: this is the record string by the registry
  // Updatable only by the owner
  string issuance_id = 4 [ (gogoproto.nullable) = true ];
  // The nominal value of the asset at notarisation
  CurrencyValue currency_value = 5;
  // Expiration date / aka the final agreed payment due date in unix timestamp
  // This maps to InvoiceUpdatedPaymentDueDate in the ODP (updated by the obligor)
  // For a given date, we consider the end of the day in UTC at 18:00
  uint64 expiration = 6;
  // Collateralised reference available if asset has been used as collateral
  // i.e. the tokenfactory denom
  string collateral_ref = 8 [ (gogoproto.nullable) = true ];
  // On notarise, the module to call
  // The asset data will be passed as arguments
  string on_notarise_hook = 9 [(gogoproto.nullable) = true];
  // The Sender of the notarise transaction
  string notarise_proxy = 10 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}
// Input data the notarise transaction
message AssetInvoiceData {
  // odp hash
  string odp_hash = 1;
  // The nominal value of the asset at notarisation
  CurrencyValue currency_value = 2;
  // Expiration date / aka payment due date in unix timestamp
  // For a given date, we consider the end of the day in UTC at 18:00
  uint64 expiration = 3;
  // Discount rate
  // This is the rate in sdk.DecFromStr format "0.95" for 95%
  string discount_rate = 4;
  // owner
  string owner = 5 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}
Route Integration with VCV Module
The notary module now integrates with the VCV (Verifiable Credential Verification) module through route references:
- Caller Routes: Define how to verify the identity and authorization of entities making notarisation requests
 - Asset Routes: Define how to verify the validity and integrity of asset data being notarised
 - Route Validation: All routes must be pre-registered with the VCV module before being referenced in NotaryInfo
 
Routes are stored directly within the NotaryInfo structure, eliminating the need for separate route registries. When
routes are nil, no verification is performed for that particular aspect (caller or asset).