Skip to main content

Messages

Message Types

RegisterNotaryInfo

Purpose: Register a new notary configuration that DApps can use for asset notarisation.

Sender: Any address (becomes the admin if NotaryInfoAdmin is not specified)

Parameters:

  • NotaryInfo: Basic notary configuration
    • notary_info_admin: Admin address (optional, defaults to sender)
    • notarised_asset_id: Type of assets this configuration handles
  • CallerRouteAndAdditionalReq: Optional route for verifying caller credentials
  • AssetRouteAndAdditionalReq: Optional route for verifying asset data

VCV Integration (x/notary/keeper/ms_notaryinfo.go:56,66):

  • Both routes are validated by calling VcvKeeper.CheckAppOrRouteOnVerifier to ensure they exist on the verifier contracts
  • If a route doesn't exist, the transaction fails with ErrVPRouteNotFound
  • Routes can be nil - when nil, no verification is performed for that aspect

Returns: NotaryInfoId for the newly registered configuration

UpdateVerifierRoutes

Purpose: Update the verification routes for an existing notary configuration.

Sender: Must be the admin of the NotaryInfo

Parameters:

  • NotaryInfoId: ID of the NotaryInfo to update
  • CallerRouteAndAdditionalReq: New caller route (optional)
  • AssetRouteAndAdditionalReq: New asset route (optional)

VCV Integration (x/notary/keeper/ms_notaryinfo.go:99,110):

  • Routes are validated by calling VcvKeeper.CheckAppOrRouteOnVerifier
  • Routes are only updated if explicitly provided (nil-safe updates)
  • Allows selective updates of either caller or asset routes independently

UpdateAdmin

Purpose: Transfer admin rights to a new address.

Sender: Must be the current admin of the NotaryInfo

Parameters:

  • NotaryInfoId: ID of the NotaryInfo to update
  • NewAdmin: New admin address

VCV Integration: None - no verification required for admin updates

RemoveNotaryInfo

Purpose: Delete a notary configuration.

Sender: Must be the admin of the NotaryInfo

Parameters:

  • NotaryInfoId: ID of the NotaryInfo to remove

Effects:

  • Removes the entire NotaryInfo configuration including all routes
  • Future MsgNotarise calls with this NotaryInfoId will fail

VCV Integration: None - no verification required for removal

Notarise

Purpose: Notarise an asset by providing verifiable presentations that prove asset validity.

Sender: Any address (must satisfy caller route requirements if configured)

Parameters:

  • NotaryInfoId: ID of the notary configuration to use
  • VerifierInput: Verifiable presentation bytes for asset verification
  • AssetData: JSON-encoded asset data (structure depends on asset type)
  • Owner: Asset owner address
  • MaxNotariseFee: Optional maximum fee willing to pay (nil = no limit)

VCV Integration:

  1. Caller Verification (via VCV AnteHandler):

    • If a caller route is configured in the NotaryInfo, the VCV AnteHandler intercepts the transaction
    • The notary keeper's GetRouteAndRequirements method is called (x/notary/keeper/verifier_router.go:16-41)
    • Returns the caller route with additional requirements (e.g., notaryinfoid)
    • VCV verifies the caller's VP (from transaction ExtensionOptions) against the route
    • If verification fails, the transaction is rejected before execution
  2. Asset Verification (during message execution):

    • The Notarise keeper method calculates the AssetId as SHA256 hash of asset data (x/notary/keeper/keeper_notarise.go:63)
    • The calculated AssetId is added to the asset route's additional requirements (x/notary/keeper/keeper_notarise.go:69)
    • Calls VcvKeeper.VerifiablePresentationChecker with the verifier input and asset route (x/notary/keeper/keeper_notarise.go:70)
    • VCV routes the verification to the configured verifier contract
    • If verification fails, the notarisation is rejected with an error

Returns: AssetId - the unique identifier for the notarised asset

Additional Processing:

  • Calculates notarisation fee based on asset value and currency conversion rates
  • Transfers fee from sender to module account and burns it
  • Stores the NotarisedAsset in state
  • Emits EventNotarise with the asset ID and fee burned