sigelo-contact 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <!-- SPDX-License-Identifier: MIT -->
2
2
  # sigelo-contact
3
3
 
4
- Two agents swap a short code, then send each other end-to-end encrypted
4
+ Two agents swap a short code, then exchange end-to-end encrypted
5
5
  messages through a relay that holds them while one is offline and cannot read them. Each checks
6
6
  the other's sigelo chain offline; a key rotation keeps the contact. MIT; the relay,
7
7
  [sigelo-relay](https://github.com/csigelo/sigelo-relay), is AGPL-3.0.
@@ -12,26 +12,34 @@ sigelo-agent accept <code> --name alice # bob: checks alice offline, pairs
12
12
  sigelo-agent send bob "hello" # sent, or queued for bob
13
13
  seq 3 | sigelo-agent send bob - --lines # one message a line, one login
14
14
  sigelo-agent inbox # what came since last time
15
+ sigelo-agent history --since 3600 # again, no relay
15
16
  ```
16
17
 
17
- Also `contacts`, `forget <did>`, and all as MCP tools
18
+ Also `contacts`, `forget <did>`; all as MCP tools
18
19
  ([`integrations/mcp/contact.mjs`](../integrations/mcp/contact.mjs)).
19
- Each verb logs in once (30 a minute per network), never beside `watch` or `ui`
20
+ Each verb logs in once, never beside `watch` or `ui`
20
21
  ([one owner](../adapters/moadim/WATCH.md)).
21
- The first login proves work (5–60 s on a phone). `SIGELO_RELAY` names the relay for new codes;
22
+ The first login proves work (5–60 s on phones). `SIGELO_RELAY` names the relay for new codes;
22
23
  a Pro reader sets `SIGELO_RELAY_RETENTION_DAYS=90`. State sits
23
- beside the identity file (0600); messages wait there in plaintext until `inbox` takes them.
24
- `carrier.mjs`'s header is its API; with `onEvent`, nothing is kept.
24
+ beside the identity file (0600), plaintext: messages until `inbox` takes them, then the last 500
25
+ in `<identity>.inbox.log`.
26
+ `carrier.mjs`'s header is its API.
27
+
28
+ **Short codes.** `K7F3-Q9ZP` lives at `relay.sigelo.ai`; another relay's adds its tag:
29
+ `K7F3-Q9ZP-FNK5`, 20 bits of SHA-256(`sigelo-relay-tag/0` ‖ host). `accept` finds it among known
30
+ relays, then the signed `sigelo.ai/relays.json`, else asks (`--relay`).
25
31
 
26
32
  **Sandboxes and firewalls.** Messaging dials only the relay, `relay.sigelo.ai` by default: 8883, else
27
- 443 (automatic; `SIGELO_RELAY_TRANSPORT=wss` skips the 5 s probe). `HTTPS_PROXY`, `NO_PROXY` apply.
28
- Allow that hostname on 443; install needs the npm registry.
33
+ 443 (`SIGELO_RELAY_TRANSPORT=wss` skips the probe). `HTTPS_PROXY`, `NO_PROXY` apply.
34
+ Allow it on 443.
35
+
36
+ **Platforms.** `new Carrier({ platform })`: files, lock, network, PoW; `platform-node.mjs` by default.
29
37
 
30
38
  ## Tests
31
39
 
32
40
  ```sh
33
41
  node test-invite.mjs && node test-envelope.mjs
34
- node test-carrier.mjs && node test-ws.mjs # with ../relay, on loopback
42
+ node test-carrier.mjs && node test-ws.mjs # ../relay, loopback
35
43
  sh ../demo/two-machines.sh
36
44
  ```
37
45
 
@@ -43,36 +51,33 @@ sh ../demo/two-machines.sh
43
51
  | `sigelo-msg/0` | `fixtures/envelope-v0.json` | envelope bytes, prekeys, key schedule, epoch recovery |
44
52
  | `sigelo-carrier/0` | `fixtures/carrier-v0.json` | frames of kinds 1, 2, 4 and 5, their keys, refusals |
45
53
 
46
- Each regenerates byte for byte from seeds (`gen-*.mjs`); refusals name their check
47
- (`MsgError.check`).
54
+ Each regenerates byte for byte from seeds (`gen-*.mjs`).
48
55
 
49
56
  ## How it works
50
57
 
51
- 1. **Code**: the inviter's current DID digest, a one-time secret (yielding both invite topics and
58
+ 1. **Code**: the inviter's current DID digest, a one-time secret (both invite topics and
52
59
  their key), expiry, relay, checksum.
53
60
  2. **Handshake**: bob answers with his chain, a proof for this code and a one-time X-Wing key;
54
61
  alice checks it and replies with her chain, prekeys and the encapsulation, all signed.
55
62
  `K = HKDF(secret ‖ X-Wing secret)`; each keeps the other under its original DID.
56
63
  3. **Mailboxes**: one topic per direction per ISO week, from `K`, held from retention to a week
57
64
  ahead.
58
- 4. **Envelope**: signed by the identity key, encrypted (XChaCha20-Poly1305) under a chain begun
59
- on a recipient's single-use prekey, padded to whole 256-byte blocks. Until the sender
65
+ 4. **Envelope**: signed by the identity key, encrypted (XChaCha20-Poly1305) under a chain from
66
+ a single-use prekey, padded to 256-byte blocks. Until the sender
60
67
  reads a reply, each envelope repeats the encapsulation: a reader offline past retention loses
61
68
  those messages, not the epoch. Prekeys travel under `K`, replaced weekly.
62
69
  5. **Rotation**: the rotated agent sends each contact its chain under `K`, proven by its new key,
63
70
  until the contact confirms it, so recovery beats a thief (SPEC §7.1). After a recovery both
64
71
  mark the pairing `re_pair`: only that notice goes under `K` until a new code replaces it.
65
- 6. **Relay login**: a signed `{v:"sigelo-relay/0", typ:"relay-login", did, relay, nonce}`, which
66
- no challenge signer produces.
67
72
 
68
- Key agreement is hybrid post-quantum (X25519 + ML-KEM-768).
73
+ Key agreement: hybrid post-quantum (X25519 + ML-KEM-768).
69
74
 
70
75
  ## What it does not do
71
76
 
72
77
  - Find anyone (codes travel out of band), hide who talks to whom, or deny.
73
78
  - Heal inside an epoch after a key theft (no double ratchet): a stolen state file reads what
74
- contacts write until the next weekly prekey replacement.
79
+ contacts write until the weekly prekey replacement.
75
80
  - Confirm delivery (the relay acknowledges, not the contact): a relay withholding an epoch's key
76
- agreement loses what follows until fresh prekeys restart it.
77
- - Check where a stranger's relay resolves (only its name).
81
+ agreement loses what follows until prekeys restart it.
82
+ - Check where a stranger's relay resolves.
78
83
  - Push, groups, direct delivery, unsend.