Skip to content

Failure

/home/runner/work/nspec/nspec/docs/arch/node/engines/commitment.juvix.md:63-69:35-1: error: Juvix code blocks with attribute extract-module-statements must contain a single local module


icon: octicons/project-template-24 search: exclude: false tags: - commitment - engines


Juvix imports
module arch.node.engines.commitment;

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

import arch.node.engines.commitment_messages open public;
import arch.node.engines.commitment_environment open public;
import arch.node.engines.commitment_behaviour open public;
open commitment_environment_example;

Commitment Engine

The Commitment engine is responsible for generating commitments (signatures) by a particular identity. Commitment engine instances are generated by the Identity Management Engine when an identity is generated or connected.

Purpose

The Commitment Engine maintains signing capabilities for a specific identity and handles commitment (signature) requests for that identity. Only the original caller and anyone to whom they pass the engine instance reference can send messages to the instance and generate commitments by the corresponding identity.

Components

  • Commitment Messages
  • Commitment Environment
  • Commitment Behaviour

???

Type

CommitmentEngine : Type := Engine
  CommitmentLocalState
  CommitmentMailboxState
  CommitmentTimerHandle
  CommitmentMatchableArgument
  CommitmentActionLabel
  CommitmentPrecomputation;

Example of a commitment engine

exampleCommitmentEngine : CommitmentEngine := mkEngine@{
    name := "commitment";
    behaviour := commitmentBehaviour;
    initEnv := commitmentEnvironmentExample;
  };

where commitmentEnvironmentExample is defined as follows:

axiom dummyExternalIdentity : ExternalIdentity;

axiom dummyIDBackend : Backend;

axiom dummySigningKey : SigningKey;

commitmentEnvironmentExample : CommitmentEnvironment :=
mkEngineEnvironment@{
name := "commitment";
localState :=
mkCommitmentLocalState@{
signer :=
mkSigner@{
sign := \ {_ x := Ed25519Signature}
};
backend := BackendLocalMemory
};
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := []
};