IDotnsPopResolver

Git Source

Title: IDotnsPopResolver

Resolver for per-name records produced by the PoP username flow.

Holds three record kinds:

  • Chat key: ECDH public-key bytes used for end-to-end encrypted messaging.
  • Lite link: for a full-person node, the labelhash of the lite-person username it was minted from (when the link was made).
  • Full claim: reverse index mapping a lite labelhash to the full-person node it was promoted to. Mirrors liteLink on every write so a caller that holds a lite labelhash can resolve the full-person node without scanning events. Lives separately from the per-user LabelStore so that the store can remain a labels-only, protocol-write / user-read surface, and follows the project's resolver-per-record-category convention used by @custom:contract IDotnsContentResolver and

Notes:

  • contract: IDotnsReverseResolver. Write authorisation is delegated to the address registered as DotnsProtocolRegistry.POP_CONTROLLER at call time, so rotating the PoP controller is a single set on the protocol registry with no resolver upgrade required.

  • security-contact: admin@parity.io

Functions

setChatKey

Sets the chat key for node.

Callable only by the address registered under DotnsProtocolRegistry.POP_CONTROLLER, otherwise @custom:reverts NotPopController. Overwrites any previous value. The payload must be exactly 65 bytes: the uncompressed secp256k1 public key encoding (1 prefix byte followed by the 32-byte X and 32-byte Y affine coordinates); any other length reverts with @custom:reverts InvalidChatKeyLength. Emits @custom:emits ChatKeyUpdated on every successful write.

function setChatKey(bytes32 node, bytes calldata chatKey) external;

Parameters

NameTypeDescription
nodebytes32The node whose chat key is being written.
chatKeybytesECDH public key bytes (pallet-side type is [u8; 65]).

Sets the lite-person link for a full-person node.

Callable only by the authorised PoP controller, otherwise

Notes:

  • reverts: NotPopController. Overwrites any previous link. When overwriting, the stale inverse entry is nulled so both the forward (liteLink) and reverse (fullClaim) indices remain consistent: re-linking the same fullNode to a new liteLabelhash clears fullClaim(oldLite), and re-linking the same liteLabelhash to a new fullNode clears liteLink(oldFull). The invariant fullClaim(liteLink(node)) == node always holds after the call. Emits

  • emits: LiteLinkUpdated on every successful write.

function setLiteLink(bytes32 fullNode, bytes32 liteLabelhash) external;

Parameters

NameTypeDescription
fullNodebytes32The full-person node carrying the link.
liteLabelhashbytes32The labelhash of the linked lite-person username.

chatKey

Returns the chat key associated with a node.

function chatKey(bytes32 node) external view returns (bytes memory chatKey);

Parameters

NameTypeDescription
nodebytes32The node to query.

Returns

NameTypeDescription
chatKeybytesThe stored chat key bytes, or empty if unset.

Returns the lite-person labelhash linked to a full-person node.

function liteLink(bytes32 fullNode) external view returns (bytes32 liteLabelhash);

Parameters

NameTypeDescription
fullNodebytes32The full-person node to query.

Returns

NameTypeDescription
liteLabelhashbytes32The linked lite-person labelhash, or zero if unset.

fullClaim

Returns the full-person node a given lite label has claimed.

Reverse of @custom:function liteLink. Written by the same setLiteLink call so the two directions stay in lockstep. Returns zero when the lite label has never been linked to a full claim.

function fullClaim(bytes32 liteLabelhash) external view returns (bytes32 fullNode);

Parameters

NameTypeDescription
liteLabelhashbytes32The labelhash of the lite-person username to query.

Returns

NameTypeDescription
fullNodebytes32The full-person node claimed from this lite label, or zero if unset.

Events

ChatKeyUpdated

Emitted when a node's chat key is set or updated.

event ChatKeyUpdated(bytes32 indexed node, bytes chatKey);

Parameters

NameTypeDescription
nodebytes32The node whose chat key was written.
chatKeybytesThe new chat key bytes.

LiteLinkUpdated

Emitted when a full-person node's lite link is set or updated.

event LiteLinkUpdated(bytes32 indexed fullNode, bytes32 indexed liteLabelhash);

Parameters

NameTypeDescription
fullNodebytes32The full-person node carrying the link.
liteLabelhashbytes32The labelhash of the linked lite-person username.

Errors

NotPopController

Thrown when the caller is not the authorised PoP controller.

error NotPopController(address caller);

Parameters

NameTypeDescription
calleraddressThe address that attempted the write.

InvalidChatKeyLength

Thrown when the provided chat key does not match the expected 65-byte length.

error InvalidChatKeyLength(uint256 length);

Parameters

NameTypeDescription
lengthuint256The length of the payload that was rejected.