🔐 Secure Enclave bridge + BrightLink agent
BrightNexus

A macOS status-bar app that bridges Node.js and the BrightChain stack to Apple's Secure Enclave, and hosts the BrightLink agent for the bsh shell. Hardware-backed P-256 signing, host-resident secp256k1 ECIES, TOTP-gated key export — all over a local Unix socket. Zero network surface.

# probe the bridge — JSON in, JSON out, no newlines
$ printf '%s' '{"cmd":"HEARTBEAT"}' \
> | nc -U ~/.brightchain/brightnexus/brightnexus.sock
{"ok":true,"timestamp":"2026-05-21T17:02:11Z","service":"enclave-bridge"}
# sign with the Secure Enclave (P-256, hardware)
$ node -e "..." # via @digitaldefiance/enclave-bridge-client
signature: MEUCIQ...== (DER)
# private bytes never leave the SEP. ever.
$ Install → View on GitHub

One menu-bar app, two protocol roles.

BrightNexus is a SwiftUI status-bar application for macOS Apple Silicon. It opens a single Unix domain socket in your home directory and serves two layered protocols on it:

🔐 Enclave Bridge Protocol (EBP/1)

The original Enclave Bridge wire surface, preserved byte-for-byte. JSON-over-Unix-socket commands that proxy a curated subset of cryptographic operations: ECDSA signing with a non-extractable Secure Enclave P-256 key, ECIES decryption with a host-resident secp256k1 key, optional TOTP-gated key export. Reference client is @digitaldefiance/enclave-bridge-client.

🛰️ BrightLink agent

Renamed from Enclave Bridge. This project was previously published as Enclave Bridge. The rename reflects the broader role: BrightLink agent + BrightChain hardware nexus, not just a single-purpose ECIES decrypt proxy. The EBP/1 wire surface is unchanged. Existing Node clients keep working — see the migration notes below.

Why "Nexus"?

The name BrightNexus is a nod to the concept of a unified "everything" where time and space are no longer barriers. In the same way that our BrightSpacetime standard unifies [t, x, y, z] into a single 4D Cartesian vector, the Nexus serves as the bridge between the legacy compute environment and the secure, multidimensional filesystem of the future.

BrightLink over this bridge is what allows us to project meaningful, verified data from the secure enclave into the user's workspace — effectively "linking" reality into the digital stream.

Single socket, two trust domains.

The bridge is a small SwiftUI app that lives in your menu bar. It opens an AF_UNIX socket under your home directory, accepts concurrent client connections, and dispatches each accepted file descriptor to its own DispatchQueue. The protocol framing is plain UTF-8 JSON, one object per request, one per response.

┌──────────────────────┐ Unix socket ┌────────────────────────────┐ │ Node.js application │ ~/.brightchain/brightnexus/ │ BrightNexus (SwiftUI) │ │ │ brightnexus.sock │ │ │ ┌────────────────┐ │ ──────────────────────────► │ BridgeProtocolHandler │ │ │ enclave-bridge │ │ │ ├─ ECIES (secp256k1) │ │ │ -client │ │ EBP/1 + BrightLink JSON │ ├─ SecureEnclaveKeyMgr │ │ └────────────────┘ │ ◄───────────────────────────│ ├─ TOTP (RFC 6238) │ │ ┌────────────────┐ │ │ └─ AppState / SocketSrv │ │ │ node-ecies-lib │ │ │ │ │ └────────────────┘ │ │ │ │ └──────────────────────┘ │ ▼ │ │ ┌──────────────────────┐ │ │ │ Apple Secure Enclave │ │ │ │ (P-256, hardware) │ │ │ └──────────────────────┘ │ └────────────────────────────┘

🔑 Two keys, two trust domains

Secure Enclave P-256 — generated inside the SEP with kSecAttrAccessibleWhenUnlockedThisDeviceOnly and .privateKeyUsage. Bytes are non-extractable. Signs with ECDSA-SHA256.

Host-resident secp256k1 — 32 raw bytes at ~/.brightchain/brightnexus/ecies-privkey.bin (mode 0600). Used for ECIES decryption with AES-256-GCM (12-byte IV, 16-byte tag) and HKDF-SHA256, byte-compatible with @digitaldefiance/node-ecies-lib.

📁 Disk layout

One per-user directory tree under ~/.brightchain/, mode 0700 throughout:

~/.brightchain/ vendor namespace ~/.brightchain/brightnexus/ app state ~/.brightchain/brightnexus/brightnexus.sock EBP/1 + BrightLink socket ~/.brightchain/brightnexus/ecies-privkey.bin secp256k1 priv (0600) ~/.brightchain/brightnexus/totp-config.json TOTP secrets (0600) ~/.brightchain/brightnexus/brightnexus.geo.path geo socket pointer (v3)

For backward compatibility, BrightNexus also binds a secondary socket at ~/.enclave/enclave-bridge.sock and routes traffic from both into the same protocol handler. On first launch it migrates ecies-privkey.bin and totp-config.json from ~/.enclave/ into ~/.brightchain/brightnexus/ via atomic rename(2). Existing keys are preserved.

Fourteen commands, all JSON.

Every request is a JSON object with at least a cmd field; every response is either a command-specific success object or {"error":"<reason>"}. Binary fields (public keys, signatures, ciphertexts) are standard Base64 with padding. There is no length prefix and no newline delimiter — the server reads complete JSON objects from the byte stream.

Command Purpose
HEARTBEAT Liveness probe with timestamp
VERSION / INFO App version, build, platform, uptime
STATUS Peer-key flag, enclave availability
METRICS Service uptime, reserved counters
GET_PUBLIC_KEY Bridge's secp256k1 public key (for ECIES)
GET_ENCLAVE_PUBLIC_KEY Secure Enclave P-256 public key
SET_PEER_PUBLIC_KEY Cache a peer's secp256k1 public key on this connection
LIST_KEYS Enumerate keys with TOTP status & fingerprints
ENCLAVE_SIGN ECDSA-SHA256 over P-256 in the SEP
ENCLAVE_DECRYPT ECIES decrypt with the bridge secp256k1 private key
ENCLAVE_GENERATE_KEY Reserved (returns error in EBP/1)
ENCLAVE_ROTATE_KEY Reserved (returns error in EBP/1)
ENABLE_TOTP Enable per-key TOTP, emit provisioning URI
EXPORT_KEY Export public key, gated by TOTP if enabled
secp256k1 + AES-256-GCM P-256 ECDSA-SHA256 HKDF-SHA256 12-byte IV 16-byte tag RFC 6238 TOTP Base64 wire format

Full specification: Enclave Bridge Protocol (EBP/1).

Install BrightNexus.

🛠️

Build from source

BrightNexus is a SwiftUI app for macOS Apple Silicon. macOS 13+ and Xcode 15+ are required.

1

Clone

git clone https://github.com/Digital-Defiance/BrightNexus.git
cd BrightNexus
2

Open in Xcode & build

open BrightNexus.xcodeproj
# Select the BrightNexus scheme, then ⌘R to run.
3

Install the Node client

npm install @digitaldefiance/enclave-bridge-client

The client package name is unchanged from the Enclave Bridge era; the wire surface it speaks is the EBP/1 surface plus the BrightLink extension.

4

Sanity-check the socket

printf '%s' '{"cmd":"HEARTBEAT"}' \
  | nc -U ~/.brightchain/brightnexus/brightnexus.sock

🔁

Migrating from Enclave Bridge

If you previously installed the standalone Enclave Bridge app:

  • Quit the old menu-bar app first. It must not be running when BrightNexus starts.
  • Launch BrightNexus. On first run it migrates ~/.enclave/ecies-privkey.bin and ~/.enclave/totp-config.json into ~/.brightchain/brightnexus/ via atomic rename(2). Your secp256k1 identity, TOTP secrets, and persistent ECIES public key are preserved.
  • Existing Node clients keep working. The bridge binds a compatibility socket at ~/.enclave/enclave-bridge.sock for one major version. Update clients to look at ~/.brightchain/brightnexus/brightnexus.sock at your leisure.
  • Delete the old app from /Applications after confirming BrightNexus is healthy.

The on-disk key file format, the TOTP config JSON, and the EBP/1 wire surface are all unchanged.

What you trust, and what you don't.

✅ What's hardware-bound

The Secure Enclave P-256 private key is generated inside the SEP with kSecAttrAccessibleWhenUnlockedThisDeviceOnly and .privateKeyUsage. Even root cannot read its bytes. ENCLAVE_SIGN and the BrightLink transcript signature both pass through this key.

The host secp256k1 private key sits at rest under POSIX 0600 in your home directory. For defense in depth (encrypted with a user password before being addressed to the bridge), the SecureEnclaveKeyring consumer in brightchain-api-lib layers password-AES-GCM and ECIES-to-the-bridge into a single double-encrypted blob.

⚠️ What's in scope

Any local process running as your user that can connect(2) to the socket can issue any EBP/1 command while the bridge is running. EXPORT_KEY can be gated by RFC 6238 TOTP per key; ENCLAVE_SIGN and ENCLAVE_DECRYPT are not gated by TOTP in EBP/1. Quitting the menu-bar app revokes both capabilities until you relaunch.

No network listeners. No telemetry. No third-party services. The bridge speaks only on a Unix domain socket inside your home directory, with filesystem permissions enforced by macOS.

For the BrightLink threat model see BrightLink RFC §14.

The BrightChain stack.

🐚

bsh — BrightShell

The zsh-compatible shell whose bsh-inject builtin delivers BrightLink credentials to BrightNexus over the EBP/1 socket. Tools speak directly to the bridge — no terminal emulator participation, no PTY scraping. site · source

📦

enclave-bridge-client

TypeScript client for EBP/1. Drop-in replacement; package name unchanged across the rename. npm · source

🔐

node-ecies-lib

The DD-ECIES wire format the bridge speaks for ENCLAVE_DECRYPT and LINK_REGISTER: secp256k1 + AES-256-GCM + HKDF-SHA256, byte-compatible across languages. npm · spec

⛓️

BrightChain

The platform consuming BrightNexus. The SecureEnclaveKeyring in brightchain-api-lib uses BrightNexus as its tier-1 key custody provider on Apple Silicon. source

🛰️

BrightDate

The decimal-SI temporal foundation referenced by BrightLink transcript and payload timestamps. site

📄

EBP/1 specification

Replication-grade specification of the bridge's command surface, ECIES wire format, and SEP key custody. read it