Skip to content
Juvix imports

module arch.node.engines.signs_for_messages;

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

Signs For Messages

Message interface

MsgSignsForRequest RequestSignsFor

type RequestSignsFor :=
mkRequestSignsFor@{
externalIdentityA : ExternalIdentity;
externalIdentityB : ExternalIdentity;
};

A RequestSignsFor queries whether externalIdentityA can sign on behalf of externalIdentityB.

Arguments
externalIdentityA:
The identity attempting to sign.
externalIdentityB:
The identity on whose behalf the signature is made.

MsgSignsForResponse ResponseSignsFor

type ResponseSignsFor :=
mkResponseSignsFor@{
signsFor : Bool;
err : Option String;
};

A ResponseSignsFor indicates whether the signs_for relationship exists.

Arguments
signsFor:
True if externalIdentityA can sign for externalIdentityB, False otherwise.
err:
An error message if the query failed.

MsgSubmitSignsForEvidenceRequest RequestSubmitSignsForEvidence

type RequestSubmitSignsForEvidence :=
mkRequestSubmitSignsForEvidence@{evidence : SignsForEvidence};

A RequestSubmitSignsForEvidence submits evidence of a signs_for relationship.

Arguments
evidence:
The evidence supporting the signs_for relationship.

MsgSubmitSignsForEvidenceResponse ResponseSubmitSignsForEvidence

type ResponseSubmitSignsForEvidence :=
mkResponseSubmitSignsForEvidence@{err : Option String};

A ResponseSubmitSignsForEvidence acknowledges the submission of evidence.

Arguments
err:
An error message if the submission failed.

MsgQuerySignsForEvidenceRequest RequestQuerySignsForEvidence

type RequestQuerySignsForEvidence :=
mkRequestQuerySignsForEvidence@{externalIdentity : ExternalIdentity};

A RequestQuerySignsForEvidence queries all signs_for evidence related to an identity.

Arguments
externalIdentity:
The identity for which to retrieve evidence.

MsgQuerySignsForEvidenceResponse ResponseQuerySignsForEvidence

type ResponseQuerySignsForEvidence :=
mkResponseQuerySignsForEvidence@{
externalIdentity : ExternalIdentity;
evidence : Set SignsForEvidence;
err : Option String;
};

A ResponseQuerySignsForEvidence provides the requested evidence.

Arguments
evidence:
A set of SignsForEvidence related to the identity.
err:
An error message if the query failed.

SignsForMsg

type SignsForMsg :=
| MsgSignsForRequest RequestSignsFor
| MsgSignsForResponse ResponseSignsFor
| MsgSubmitSignsForEvidenceRequest RequestSubmitSignsForEvidence
| MsgSubmitSignsForEvidenceResponse ResponseSubmitSignsForEvidence
| MsgQuerySignsForEvidenceRequest RequestQuerySignsForEvidence
| MsgQuerySignsForEvidenceResponse ResponseQuerySignsForEvidence;

Message sequence diagrams

Submitting Signs For Evidence

sequenceDiagram
    participant Client
    participant SignsForEngine

    Client->>SignsForEngine: RequestSubmitSignsForEvidence
    Note over SignsForEngine: Process and store evidence
    SignsForEngine->>Client: ResponseSubmitSignsForEvidence
Submitting evidence of a signs_for relationship

Querying Signs For Relationship

sequenceDiagram
    participant Client
    participant SignsForEngine

    Client->>SignsForEngine: RequestSignsFor (X signs for Y?)
    Note over SignsForEngine: Check stored evidence
    SignsForEngine->>Client: ResponseSignsFor
Querying whether a specific signs_for relationship exists

Retrieving Signs For Evidence

sequenceDiagram
    participant Client
    participant SignsForEngine

    Client->>SignsForEngine: RequestQuerySignsForEvidence (for X)
    Note over SignsForEngine: Retrieve relevant evidence
    SignsForEngine->>Client: ResponseQuerySignsForEvidence
Retrieving all signs_for evidence related to a particular identity

Engine Components