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 configurationnotary_info_admin: Admin address (optional, defaults to sender)notarised_asset_id: Type of assets this configuration handles
CallerRouteAndAdditionalReq: Optional route for verifying caller credentialsAssetRouteAndAdditionalReq: Optional route for verifying asset data
VCV Integration (x/notary/keeper/ms_notaryinfo.go:56,66):
- Both routes are validated by calling
VcvKeeper.CheckAppOrRouteOnVerifierto 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 updateCallerRouteAndAdditionalReq: 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 updateNewAdmin: 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
MsgNotarisecalls with thisNotaryInfoIdwill 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 useVerifierInput: Verifiable presentation bytes for asset verificationAssetData: JSON-encoded asset data (structure depends on asset type)Owner: Asset owner addressMaxNotariseFee: Optional maximum fee willing to pay (nil = no limit)
VCV Integration:
-
Caller Verification (via VCV AnteHandler):
- If a caller route is configured in the NotaryInfo, the VCV AnteHandler intercepts the transaction
- The notary keeper's
GetRouteAndRequirementsmethod 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
-
Asset Verification (during message execution):
- The
Notarisekeeper method calculates theAssetIdas SHA256 hash of asset data (x/notary/keeper/keeper_notarise.go:63) - The calculated
AssetIdis added to the asset route's additional requirements (x/notary/keeper/keeper_notarise.go:69) - Calls
VcvKeeper.VerifiablePresentationCheckerwith 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
- The
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
NotarisedAssetin state - Emits
EventNotarisewith the asset ID and fee burned