Skip to content
Juvix imports

module arch.node.engines.naming_messages;

import prelude open;
import arch.node.types.identities open;

Naming Messages

Message interface

MsgNamingResolveNameRequest RequestResolveName

type RequestResolveName := mkRequestResolveName@{identityName : IdentityName};

A RequestResolveName asks the Naming Engine which ExternalIdentitys are associated with a given IdentityName.

Arguments
identityName:
The name to resolve.

MsgNamingResolveNameResponse ResponseResolveName

type ResponseResolveName :=
mkResponseResolveName@{
externalIdentities : Set ExternalIdentity;
err : Option String;
};

A ResponseResolveName is returned in response to a RequestResolveName.

Arguments
externalIdentities:
A set of ExternalIdentitys associated with the IdentityName.
err:
An error message if the resolution failed.

MsgNamingSubmitNameEvidenceRequest RequestSubmitNameEvidence

type RequestSubmitNameEvidence :=
mkRequestSubmitNameEvidence@{evidence : IdentityNameEvidence};

A RequestSubmitNameEvidence instructs the Naming Engine to store a new piece of IdentityNameEvidence.

Arguments
evidence:
The evidence supporting the association between an IdentityName and an ExternalIdentity.

MsgNamingSubmitNameEvidenceResponse ResponseSubmitNameEvidence

type ResponseSubmitNameEvidence :=
mkResponseSubmitNameEvidence@{err : Option String};

A ResponseSubmitNameEvidence is sent in response to a RequestSubmitNameEvidence.

Arguments
err:
An error message if the submission failed.

MsgNamingQueryNameEvidenceRequest RequestQueryNameEvidence

type RequestQueryNameEvidence :=
mkRequestQueryNameEvidence@{externalIdentity : ExternalIdentity};

A RequestQueryNameEvidence instructs the Naming Engine to return any known IdentityNames and IdentityNameEvidence associated with a specific ExternalIdentity.

Arguments
externalIdentity:
The identity for which to retrieve evidence.

MsgNamingQueryNameEvidenceResponse ResponseQueryNameEvidence

type ResponseQueryNameEvidence :=
mkResponseQueryNameEvidence@{
externalIdentity : ExternalIdentity;
evidence : Set IdentityNameEvidence;
err : Option String;
};

A ResponseQueryNameEvidence provides the requested evidence.

Arguments
externalIdentity:
The ExternalIdentity associated with the returned evidence.
evidence:
A set of IdentityNameEvidence related to the identity.
err:
An error message if the query failed.

NamingMsg

type NamingMsg :=
| MsgNamingResolveNameRequest RequestResolveName
| MsgNamingResolveNameResponse ResponseResolveName
| MsgNamingSubmitNameEvidenceRequest RequestSubmitNameEvidence
| MsgNamingSubmitNameEvidenceResponse ResponseSubmitNameEvidence
| MsgNamingQueryNameEvidenceRequest RequestQueryNameEvidence
| MsgNamingQueryNameEvidenceResponse ResponseQueryNameEvidence;

Message sequence diagrams

Resolving a Name

sequenceDiagram
    participant Client
    participant NamingEngine

    Client->>NamingEngine: RequestResolveName (name)
    Note over NamingEngine: Check stored evidence
    NamingEngine->>Client: ResponseResolveName
Resolving a name

Submitting Name Evidence

sequenceDiagram
    participant Client
    participant NamingEngine

    Client->>NamingEngine: RequestSubmitNameEvidence
    Note over NamingEngine: Verify and store evidence
    NamingEngine->>Client: ResponseSubmitNameEvidence
Submitting name evidence

Querying Name Evidence

sequenceDiagram
    participant Client
    participant NamingEngine

    Client->>NamingEngine: RequestQueryNameEvidence (for ExternalIdentity)
    Note over NamingEngine: Retrieve relevant evidence
    NamingEngine->>Client: ResponseQueryNameEvidence
Querying name evidence for an identity.

Engine Components