Skip to main content

Module did_qi

Module did_qi 

Source
Expand description

Qualia Identifier (did:qi) runtime for ☉ Human-Centric Internet instruments.

This is a DID-Core shaped method runtime: create / read / update / deactivate. It is not did:q42 (Q42 Resource Coordinate), not did:hcai, and not Gate B. Git objects are in-process; UTXO attestation verifies caller-supplied Bitcoin-family transaction bytes. There is no network, Chronik, DHT, or git daemon.

Canonical document bytes use QCDE-1 (RFC 8785 profile) in [document]. The DID method-specific-id is multibase Bitcoin base58btc (z prefix) of the 32-byte SHA-256 genesis payload digest.

Structs§

AkaEntry
ChainId
CscpMailbox
DidQi
32-byte genesis digest. The DID string is did:qi:z + base58btc(this).
GitObjectStore
Outpoint
QiDocument
RelayHint
UtxoCommitment

Enums§

Disclosure
LocatorClass
QiError
Fail-closed errors. Hot paths return these without allocating.

Constants§

CONSTITUTION_MAINNET
Bitcoin mainnet genesis, first 16 bytes of block hash (CAIP-2 bip122).
CONSTITUTION_TESTNET
Bitcoin testnet3 genesis identifier (distinct ledger, same DID).
CREATED_UNIX_VECTOR
GIT_STORE_CAP
LIVE_KIND
MAX_AKA
MAX_AKA_LEN
MAX_BLOB
MAX_CANONICAL
MAX_DID_TEXT
Spec §6.3: at most 57 ASCII octets; 64 leaves headroom.
MAX_HINTS
MAX_RECORD
MAX_SERVICES
MAX_SIGNED
MAX_UNSIGNED
METHOD_NAME
DID method name. Bound in prose to the Human-Centric Internet (HCInet).
OP_RETURN
QI_MAGIC
SERVICE_TYPE
TOMBSTONE_OPCODE
Registered tombstone kind in the 35-byte OP_RETURN push (0xFF).

Traits§

QiStore
In-process document store. Implementations keep a fixed slot cap.

Functions§

admit_chain
Parse then admit. Well-formed but unlisted bip122: ids are unsupported_chain.
apply_utxo_attestation
Applies a UTXO attestation into store S.
blob_object_id
SHA-256 object id of a blob encoding of content.
canonical_digest
Alias for genesis_digest.
chain_admitted
True when chain is an admitted BIP-122 constitution identifier (spec §17.1).
check_relay_only
Spec §10.3: relay-only documents MUST NOT carry Direct locators or public DHT.
create
Creates a did:qi document in store; returns the new generation.
deactivate
Tombstones id.
decode_canonical
Reconstruct a QiDocument from QCDE-1 the encoder emits (F1).
encode_blob
Encodes content as a git blob (blob <len><content>); returns bytes written.
encode_canonical
Alias for encode_genesis — the canonical self-describing form.
encode_commitment_tx
Encodes a commitment transaction.
encode_genesis
Encode the genesis form (no id/controller — those are derived from this document’s digest). Caller-buffered canonical JSON-LD.
encode_jsonld_cold
Alias for encode_unsigned — the cold-path JSON-LD export form.
encode_signed
Canonical signed encoding — adds the proof block with the multibase-encoded Ed25519 signature.
encode_unsigned
Canonical unsigned JSON-LD encoding of the document for id.
extract_op_return
Extracts the UTXO commitment from a transaction’s OP_RETURN.
extract_proof_sig
Extract proof.proofValue (multibase-z of 64-octet Ed25519 signature).
format_did
Formats did:qi:z<base58btc(digest)> into out; BufferTooSmall when undersized.
genesis_digest
SHA-256 of the genesis encoding — the digest that names the DID.
ingest_unsigned_json
Decode then §10.3-scan. Use this for foreign JSON (Vector 4).
parse_chain_id
Parses a chain id; QiError on malformed input.
parse_did
Parses a did:qi: string; rejects other methods and non-canonical base58 encodings.
publish_qi_document
Publish each CscpMailbox service from doc into mailbox.
read
Reads the document for id into out; returns its generation.
read_generation
Spec §12.7: an older signed generation presented as current is stale.
reject_forbidden_locators
Spec §10.3 items 1–4 on QCDE-1 / JSON-LD bytes (encode output and foreign ingest).
sha256_32
SHA-256 of bytes as a fixed array.
signed_git_object_id
Git blob object-id of the canonical signed encoding — the content-addressed identity used for provenance chains.
tag_name
Annotated-tag analogue: writes qi/<generation> into out.
txid_display
Bitcoin RPC display encoding of a 32-byte SHA-256d digest (byte-reversed hex).
unsigned_digest
SHA-256 of the canonical unsigned encoding — the value the proof signs.
update
Applies an update to id, bumping the generation.
verify_commitment
Verifies a commitment digest in tx; returns the outpoint.