IDotnsPopResolver
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
liteLinkon every write so a caller that holds a lite labelhash can resolve the full-person node without scanning events. Lives separately from the per-userLabelStoreso 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_CONTROLLERat call time, so rotating the PoP controller is a singleseton 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
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node whose chat key is being written. |
chatKey | bytes | ECDH public key bytes (pallet-side type is [u8; 65]). |
setLiteLink
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 samefullNodeto a newliteLabelhashclearsfullClaim(oldLite), and re-linking the sameliteLabelhashto a newfullNodeclearsliteLink(oldFull). The invariantfullClaim(liteLink(node)) == nodealways holds after the call. Emits -
emits: LiteLinkUpdated on every successful write.
function setLiteLink(bytes32 fullNode, bytes32 liteLabelhash) external;
Parameters
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The full-person node carrying the link. |
liteLabelhash | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node to query. |
Returns
| Name | Type | Description |
|---|---|---|
chatKey | bytes | The stored chat key bytes, or empty if unset. |
liteLink
Returns the lite-person labelhash linked to a full-person node.
function liteLink(bytes32 fullNode) external view returns (bytes32 liteLabelhash);
Parameters
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The full-person node to query. |
Returns
| Name | Type | Description |
|---|---|---|
liteLabelhash | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
liteLabelhash | bytes32 | The labelhash of the lite-person username to query. |
Returns
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node whose chat key was written. |
chatKey | bytes | The 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
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The full-person node carrying the link. |
liteLabelhash | bytes32 | The labelhash of the linked lite-person username. |
Errors
NotPopController
Thrown when the caller is not the authorised PoP controller.
error NotPopController(address caller);
Parameters
| Name | Type | Description |
|---|---|---|
caller | address | The 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
| Name | Type | Description |
|---|---|---|
length | uint256 | The length of the payload that was rejected. |