Protocol Demo Embedded Custom Nodes Part 4 of 4 · Complete Simulation

DID Auth demo

Client and server workflows registered as custom nodes and wired together with fresh key pairs and nonce on every run. A learning example.

For explaining a protocol only. Do not use this in a real service. The keys shown are public demo keys.

Open in app Download .ncw

DID Auth demo

Overview & Cryptographic Context

This workflow is the fourth and final installment of the DID Auth learning suite (Key Pairs → Client → Server → End-to-End Demo). It demonstrates one of NodeCrypto's most powerful architectural features: packaging multi-node sub-workflows as content-addressed Custom Nodes (sha256:) embedded directly inside the .ncw file's definitions map.

Instead of cluttering a single canvas with 17 low-level nodes, DID Auth - Client and DID Auth - Server appear as high-level protocol blocks wired to two ECC Keypair Generator nodes and a 32-byte Random Value challenge Nonce.

Pipeline Architecture & Wiring Flow

Server & Client Keypairs + Random Nonce (32B) ──► DID Auth - Client (Custom Node) ──► DID Auth - Server (Custom Node) ──► Verified (true)
  1. Ephemeral Setup (Server Keypair, Client Keypair, Nonce): Generates fresh P-256 key pairs for both sides and a fresh 32-byte CSPRNG challenge nonce on every execution.
  2. Client Challenge Response (DID Auth - Client): Receives Client Keypair (private + public), Server Keypair.publicKey, and Nonce, outputting the client's public key and 8-byte response MAC.
  3. Server Verification (DID Auth - Server): Receives Server Keypair.privateKey, Nonce, and the client's pub and mac outputs, recomputes the ECDH-CBC tag, and emits Verified = true to Workflow Output.

Nodes & Configuration

NodeNode Role & Key ParametersCount
ECC Keypair GeneratorTwo instances (Server Keypair, Client Keypair) with curve = "p256"2
Random ValueLabeled Nonce; configured with type = "bytes", length = 321
DID Auth - Client (Custom node embedded in the file)Content-addressed custom node encapsulating the 8-node client workflow1
DID Auth - Server (Custom node embedded in the file)Content-addressed custom node encapsulating the 9-node server workflow1
Workflow OutputEmits boolean verdict Verified1

Node reference →

Inputs, Outputs & Test Vector Verification

Verification Source: independent implementation: Node crypto (reference/did-auth/did-auth.mjs); keys and nonce are random on every run, only the verdict is compared

Expected Outputs

NameTypeValue
Verifiedbooltrue