IDotnsPopResolver
Title: IDotnsPopResolver
Resolver for per-name records produced by the dotNS gateway pallet.
Holds three record kinds:
- Chat key: ECDH public-key bytes used for end-to-end encrypted messaging.
- Device link (
deviceLabelhashOf): for a personhood-name node, the labelhash of the device name it was linked to when it was issued. - Personhood link (
personhoodNodeOf): reverse index mapping a device-name labelhash to the personhood-name node it is linked to. MirrorsdeviceLabelhashOfon every write so a caller that holds a device-name labelhash can resolve the personhood name 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 this resolver needs no upgrade when that key changes. The same key decides soulbinding in the registrar, and the numeric device containers stay owned by the controller that minted them. Containers are soulbound and cannot move, so a controller at a new address could not issue device names under them: change the PoP controller by upgrading it behind its proxy. -
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]). |
setDeviceLink
Sets the device link for a personhood-name node.
Callable only by the authorised PoP controller, otherwise
Note:
reverts: NotPopController. Overwrites any previous link. When overwriting, the
stale inverse entry is nulled so both the forward (deviceLabelhashOf) and reverse
(personhoodNodeOf) indices remain consistent: re-linking the same personhoodNode to
a new deviceLabelhash clears personhoodNodeOf(oldDevice), and re-linking the same
deviceLabelhash to a new personhoodNode clears deviceLabelhashOf(oldPersonhood).
The invariant personhoodNodeOf(deviceLabelhashOf(node)) == node always holds after
the call. Emits @custom:emits DeviceLinkUpdated on every successful write.
function setDeviceLink(bytes32 personhoodNode, bytes32 deviceLabelhash) external;
Parameters
| Name | Type | Description |
|---|---|---|
personhoodNode | bytes32 | The personhood-name node carrying the link. |
deviceLabelhash | bytes32 | The labelhash of the linked device name. |
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. |
deviceLabelhashOf
Returns the device-name labelhash linked to a personhood-name node.
function deviceLabelhashOf(bytes32 personhoodNode)
external
view
returns (bytes32 deviceLabelhash);
Parameters
| Name | Type | Description |
|---|---|---|
personhoodNode | bytes32 | The personhood-name node to query. |
Returns
| Name | Type | Description |
|---|---|---|
deviceLabelhash | bytes32 | The linked device-name labelhash, or zero if unset. |
personhoodNodeOf
Returns the personhood-name node a device name is linked to.
Reverse of @custom:function deviceLabelhashOf. Written by the same setDeviceLink call
so the two directions stay in lockstep. Returns zero when the device name has never
been linked to a personhood name.
function personhoodNodeOf(bytes32 deviceLabelhash)
external
view
returns (bytes32 personhoodNode);
Parameters
| Name | Type | Description |
|---|---|---|
deviceLabelhash | bytes32 | The labelhash of the device name to query. |
Returns
| Name | Type | Description |
|---|---|---|
personhoodNode | bytes32 | The linked personhood-name node, 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. |
DeviceLinkUpdated
Emitted when a personhood name's device link is set or updated.
event DeviceLinkUpdated(bytes32 indexed personhoodNode, bytes32 indexed deviceLabelhash);
Parameters
| Name | Type | Description |
|---|---|---|
personhoodNode | bytes32 | The personhood-name node carrying the link. |
deviceLabelhash | bytes32 | The labelhash of the linked device name. |
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. |