Skip to main content

Module domain_licence

Module domain_licence 

Source
Expand description

Domain licence instruments — signed grants binding licence terms to domain names.

Implements the methodology in docs/work-in-progress/DOMAIN_LICENCE_METHODOLOGY_WIP.md: a DomainLicence is an Ed25519-signed JSON document (.qlic.json) that names subject domains, a licence class, a capability scope, a validity window, optional payment evidence, and optional chain anchors carrying the canonical digest.

Structs§

ChainAnchor
On-chain anchor carrying the canonical licence digest (WIP §4-B).
Delegation
Delegated-administration scope for steward licences (WIP §2-A).
DomainLicence
A signed domain licence instrument (WIP §3).
IssueParams
Parameters for issue. chain_anchors and signature_hex are set by the issuer; licence_id is derived from a provisional digest.
LicenceAmendment
A signed roster amendment chained to a licence by licence_id (WIP §7-13).
LicenceRegistry
On-disk registry of declared domains → licences.
LicenceStatus
Introspection view for licence_status / UI badges. Never throws.
PaymentEvidence
Payment evidence recorded at issuance (WIP §3).
RegistryEntry
One declared domain → licence mapping.
RepresentedPrincipalContext
Context binding the invoking agent to the represented principal and beneficiary.

Enums§

AgentKind
Licensee agent kind — mirrors the QDP AgentType token set in client-core/domains.rs. Unknown fails closed.
LicenceClass
Recognised licence classes (WIP §2). Unknown fails closed.
LicenceError
PrincipalCategory
Represented-principal / beneficiary usage classification (QUALIADB-IMPLEMENTATION-ROADMAP.md §13).
RegistrySource
Where a declared domain’s licence record comes from.

Constants§

COMPILED_IN_LICENSED_DOMAINS
Domains compiled into this build as licensed (WIP §4-A “compiled-in declaration”). Client-specific builds may patch this list; the default is empty — declarations should normally travel in the signed instrument.
LICENCE_FORMAT
Required format field value.

Functions§

amendment_from_json
Parse an amendment from JSON.
amendment_to_json
Serialize an amendment to JSON.
anchor_op_return
The OP_RETURN payload committing a licence digest on a nominated chain.
canonical_bytes
Canonical signed bytes for a licence (excludes signature_hex and chain_anchors).
canonical_digest
SHA-256 digest of the canonical licence bytes — the value anchored on-chain.
canonical_digest_tag
Digest rendered as "sha256:<hex>" for chain_anchors[].digest.
delegated_members
Effective member roster after applying verified amendments in seq order.
from_json
Parse a licence from its .qlic.json file form.
issue
Issue and sign a licence.
issue_amendment
Issue a signed roster amendment chained to licence_id (WIP §7-13).
licence_status
Compute a status view without failing.
normalize_domain
Normalise a domain name for comparison: lowercase, trimmed, trailing dot and a single port suffix removed.
to_json
Serialize a licence to its .qlic.json file form.
verify
Full fail-closed verification of a licence for a serving domain + scope.
verify_amendment
Verify an amendment against its base licence (id match + issuer signature).
verify_represented_principal
Verify that a DomainLicence class is valid for the RepresentedPrincipalContext.