Skip to main content

Python: Registry

RegistryClient is the on-chain half of .nota files. It wraps the NotaRegistry contract and lets you register, resolve, and revoke resources. Access it as ntm.registry. All write methods require the Notareum instance to be constructed with an account.

Write methods

register_resource

Registers a new resource and returns the transaction hash:
The resource ID is derived on-chain as keccak256(abi.encode(resource_type, chain_id, keccak256(identifier))). You can preview it with compute_resource_id below.

revoke_resource

Only the owner can revoke. Revocation does not delete; it flips is_revoked = True:

add_resource_type / remove_resource_type

Governance-only operations for managing custom resource types beyond the initial six:

Read methods

get_resource

Fetches the full ResourceInfo record:
ResourceInfo (a dataclass) includes owner, resource_type, chain_id, proof_hash, alias, verification_level, registered_at, last_updated_at, and is_revoked.

resolve_alias

Resolves a registered alias to its bytes32 resource ID (returned as a 0x-prefixed hex string):

is_valid_resource_type / get_resource_type_name

Introspection helpers over the governance-managed type registry:

Utility: compute_resource_id

Deterministically derives the resource ID locally, without any RPC round-trip. Use this to predict the ID before paying gas:

Full example

See also