228 bytes that can't be read, faked or told apart: Kengele's wire format and Nostr gift wraps in Go
The short version, for everyone: When an activist presses "I'm safe" or "help" in Kengele, a small message goes to their trusted contacts. That message can travel over the internet, by SMS, or hop phone to phone. Whoever
The short version, for everyone: When an activist presses "I'm safe" or "help" in Kengele, a small message goes to their trusted contacts. That message can travel over the internet, by SMS, or hop phone to phone. Whoever carries it (a relay server, a phone company, a stranger's phone) must not be able to read it, fake it, or even tell a cry for help from a routine check-in. This post shows exactly how that works, byte by byte, with code you can run.
Kengele is an open-source alarm for activists in East Africa. If an activist goes quiet during a watch window, each of their guardians' devices raises the alarm on its own. There is no Kengele server: messages travel over public Nostr relays, an encrypted SMS fallback, and (in v0.2) a Bluetooth mesh.
altradits
/
kengele
An alarm for when an activist goes missing. No servers, works through shutdowns. Swahili first.
Kengele
When an activist goes silent, the right people know within minutes, and nobody can switch the alarm off.
Ukinyamaza, kengele inalia. ("If you go quiet, the bell rings.")
Warning
Status: design stage. Not for real use. There is no working app yet. Do not rely on Kengele to protect anyone until an independent security review is complete and published here. People's lives may depend on this tool, so we will not cut corners to ship it sooner.
Why
When an activist disappears, how fast the public finds out often decides how quickly they are freed.
- In Kenya, more than 80 people were abducted or forcibly disappeared after the 2024 protests. In January 2025, abducted young men were released within hours of public outcry.
- Boniface Mwangi and Agather Atuhaire, detained in Tanzania in May 2025, were released after their disappearance became public.
- Governments switch networks off when itβ¦
The first post in this series covered the deadline engine that decides when to raise an alarm:
Stanley Chege Thuita
A dead man's switch that survives an internet shutdown: inside Kengele's deadline engine in Go
This one is about the message itself: the 228 bytes every check-in, duress check-in and panic is made of, and the three layers of Nostr wrapping around them.
Kengele is still in design and not for real use until an independent security review is published. All code is at commit e10d277.
Contents
- Who is the adversary on the wire?
- Five goals for one message
- The layout, byte by byte
- Signing: BIP-340 with a domain tag
- Encrypting: NIP-44 v2 per guardian
- No sender key on the wire
- Why 228 bytes and 304 characters
- Strict decoding
- The Nostr layer: rumor, seal, gift wrap
- Run it yourself: what a relay sees
- Sending through outages
- What a carrier can still see
Who is the adversary on the wire?
The threat model names several, and the wire format has to hold against all of them at once:
| Adversary | What they want | What they can do |
|---|---|---|
| A relay operator | Read check-ins, map who protects whom | Store and inspect every event they carry |
| A telecom operator or state | Spot panics, block alarms, trace activists | See every SMS: numbers, timing, content |
| A stranger's phone in a mesh | Read or alter what it carries | Hold and forward messages for hours |
| Captors with the activist's phone | Send a convincing "I'm safe" | Use the activist's real keys under coercion |
| A compromised guardian | Forge the activist's events | Hold one guardian's key |
Two things follow. First, every carrier is untrusted: the message must be secure end to end, independent of the path. Second, the path changes: the same bytes must work over a websocket to a relay, inside two SMS segments, and through a Bluetooth hop. So the format is defined once, in internal/message, and the transports only carry it.
Five goals for one message
From docs/message-format.md:
- Nobody can fake it. Each event is signed by its sender with a BIP-340 Schnorr key, the same kind of key Nostr uses.
- Carriers can't read it. Each event is encrypted separately to each guardian with NIP-44 v2.
- Carriers can't tell kinds apart. Every message is exactly the same size. A duress check-in or a panic looks like an ordinary check-in to everyone except the guardian who decrypts it.
- It fits in two SMS. The text form is 304 characters from the GSM-7 basic set: two concatenated SMS hold 306.
- The original time survives. The sender's timestamp is inside the signature, so a message delivered days later still proves when it was made.
Goal 3 is the one people underestimate. If a panic message were even one byte longer than a check-in (because it carried a location, say), a telecom could flag every panic in real time without decrypting anything. Size is metadata.
The layout, byte by byte
There are seven event kinds. Their numbers are part of the format and never change:
const (
KindCheckIn Kind = 1 // activist: "I am safe"
KindDuressCheckIn Kind = 2 // activist, forced: looks like a check-in to everyone but guardians
KindPanic Kind = 3 // activist: panic trigger
KindMissed Kind = 4 // guardian: a check-in deadline passed
KindGuardianConfirm Kind = 5 // guardian: confirms the alarm (towards 2 of 3)
KindAllClear Kind = 6 // activist or guardian: found safe, stand down
KindGoingDark Kind = 7 // activist: pre-arming before a shutdown
)
The kind travels only inside the encryption. From the outside, every message is this:
Wire message: 228 bytes
| Offset | Size | Field |
|---|---|---|
| 0 | 1 | Format version, 0x01
|
| 1 | 227 | NIP-44 v2 payload |
NIP-44 v2 payload: 227 bytes
| Offset | Size | Field |
|---|---|---|
| 0 | 1 | NIP-44 version, 0x02
|
| 1 | 32 | Random nonce |
| 33 | 162 | ChaCha20 ciphertext of a 2-byte length (always 160) and the 160-byte signed plaintext |
| 195 | 32 | HMAC-SHA256 |
Signed plaintext: 160 bytes, inside the encryption
| Offset | Size | Field |
|---|---|---|
| 0 | 1 | Kind |
| 1 | 4 | Created at: Unix seconds, big-endian |
| 5 | 4 | Sequence number, big-endian |
| 9 | 1 | Body length, 0 to 86 |
| 10 | 86 | Body, then zero padding to 86 bytes |
| 96 | 64 | BIP-340 signature |
The sizes are constants in code, derived from each other so that changing one breaks the build of the others:
const (
Version byte = 1
MaxBodySize = 86
innerSize = 1 + 4 + 4 + 1 + MaxBodySize + schnorr.SignatureSize // 160
signedSize = innerSize - schnorr.SignatureSize // 96
// version + nonce + (2-byte length + padded plaintext) + mac
nip44Size = 1 + 32 + 2 + innerSize + 32 // 227
WireSize = 1 + nip44Size // 228
TextSize = (WireSize*8 + 5) / 6 // 304 base64url characters
MaxSMSChars = 306 // two concatenated GSM-7 segments
MaxClockSkew = 10 * time.Minute
)
Why 86 bytes of body? Because 160 is a NIP-44 padding boundary. NIP-44 pads plaintexts to hide their length; by choosing a plaintext that is already exactly on a boundary, padding adds nothing, and the whole thing still fits in 304 characters. 86 bytes is enough for a typed place name ("Milimani law courts"), a 32-byte key plus a sequence number for guardian messages, or a 70-byte guardian confirmation carrying a Shamir share.
Signing: BIP-340 with a domain tag
sign builds the 160-byte plaintext and signs its first 96 bytes:
func sign(e Event, sender *btcec.PrivateKey) ([]byte, error) {
...
inner := make([]byte, innerSize)
inner[0] = byte(e.Kind)
binary.BigEndian.PutUint32(inner[1:5], uint32(ts))
binary.BigEndian.PutUint32(inner[5:9], e.Seq)
inner[9] = byte(len(e.Body))
copy(inner[10:10+MaxBodySize], e.Body)
h := signedHash(inner[:signedSize])
sig, err := schnorr.Sign(sender, h[:])
...
copy(inner[signedSize:], sig.Serialize())
return inner, nil
}
The hash is a BIP-340 tagged hash:
// signTag separates Kengele signatures from Nostr event signatures and any
// other protocol that uses the same keys (BIP-340 tagged hash).
const signTag = "kengele/event/v1"
func signedHash(data []byte) [32]byte {
tag := sha256.Sum256([]byte(signTag))
h := sha256.New()
h.Write(tag[:])
h.Write(tag[:])
h.Write(data)
...
}
This matters because Kengele keys are secp256k1 keys, the same curve and signature scheme as Nostr and Bitcoin Taproot. Without domain separation, a Kengele signature over some 96 bytes could, in principle, be presented as a valid signature in another protocol that hashes differently, or the other way round. With the tag kengele/event/v1, a Kengele signature is only ever valid as a Kengele signature.
Two deliberate choices:
- The signature does not cover the recipient. The same signed event goes to every guardian, and can later be handed to a lawyer, a court or OpenTimestamps as proof of what the activist sent and when. If the signature were bound to one guardian, that proof would be per-guardian and harder to present.
-
The time is signed.
CreatedAtis inside the signed bytes, so a message carried through a three-day shutdown still proves it was made at 14:07 on day one.
Encrypting: NIP-44 v2 per guardian
NIP-44 v2 is Nostr's audited encryption scheme: ECDH on secp256k1 gives a shared secret, HKDF turns it into a conversation key, each message gets a random 32-byte nonce, ChaCha20 encrypts and HMAC-SHA256 authenticates.
SealAll signs once and encrypts once per guardian:
func SealAll(e Event, sender *btcec.PrivateKey, recipients [][32]byte) ([][]byte, error) {
inner, err := sign(e, sender)
if err != nil {
return nil, err
}
out := make([][]byte, 0, len(recipients))
for _, r := range recipients {
w, err := encrypt(inner, sender, r, nil)
...
out = append(out, w)
}
return out, nil
}
Per-guardian encryption costs a few hundred bytes more per event than encrypting once to a group key, but it means there is no group key to leak, add guardians to or revoke. Removing a guardian is just not encrypting to them any more.
encrypt also checks that the NIP-44 output is exactly the size the format promises, and refuses to send anything else:
if len(payload) != nip44Size {
return nil, ErrSize
}
That is a cheap, permanent guard against a library upgrade silently changing padding and breaking goal 3.
No sender key on the wire
Look at the wire layout again: there is no sender public key. A carrier sees 228 random-looking bytes and nothing else. So how does a guardian know who sent it?
They try. A guardian watches over a handful of people, and Open tries each one's conversation key until one authenticates:
func Open(wire []byte, recipient *btcec.PrivateKey, senders [][32]byte, now time.Time) (*Event, error) {
if len(wire) != WireSize {
return nil, ErrSize
}
if wire[0] != Version {
return nil, ErrVersion
}
b64 := base64.StdEncoding.EncodeToString(wire[1:])
for _, s := range senders {
ck, err := conversationKey(recipient, s)
if err != nil {
continue
}
plain, err := nip44.Decrypt(b64, ck)
if err != nil {
continue // wrong sender or altered message: try the next key
}
return parse([]byte(plain), s, now)
}
return nil, ErrNoSender
}
NIP-44's MAC check makes this safe: a wrong key fails authentication, so there is no risk of "decrypting" garbage with the wrong sender. And because the signature inside is then verified against the same key that decrypted it, a compromised guardian cannot forge an activist's event: they could encrypt to another guardian, but they cannot produce the activist's Schnorr signature.
The cost is linear in the number of senders. For a family guardian with three people, that is nothing. For an organisation running a watcher for hundreds of activists, it might need a short rotating recipient hint, which would leak a little metadata. That trade-off is listed as an open question in the docs rather than decided silently.
Why 228 bytes and 304 characters
The SMS fallback is not an afterthought; in Tanzania in 2025 SMS kept working while data was off. The text form is unpadded base64url:
// EncodeText turns a wire message into the SMS-safe text form: unpadded
// base64url, whose alphabet is entirely in the GSM-7 basic character set.
func EncodeText(wire []byte) string {
return base64.RawURLEncoding.EncodeToString(wire)
}
Why base64url and not standard base64? Standard base64 uses + and /, which are in GSM-7, but its = padding and some phones' habit of joining segments with whitespace cause trouble. More importantly, every base64url character (AβZ aβz 0β9 - _) is in the GSM-7 basic set, so none costs two septets. 228 bytes become exactly 304 characters, and two concatenated SMS hold 2 Γ 153 = 306.
A single SMS is impossible, and the docs say why: the 64-byte signature plus NIP-44's 32-byte nonce and 32-byte MAC already take 171 characters before any content. Two SMS is the floor for a message that is both authenticated and confidential.
There is deliberately no "KENGELE:" prefix on the SMS. A fixed marker would let a filter at the telecom find and drop every Kengele message.
Strict decoding
Everything that comes off the wire is treated as hostile. parse checks, in order: the length, the signature, the kind, the timestamp, the body length, and that every padding byte after the body is zero.
k := Kind(inner[0])
if !k.Valid() {
return nil, ErrKind
}
ts := binary.BigEndian.Uint32(inner[1:5])
created := time.Unix(int64(ts), 0).UTC()
if ts == 0 || created.After(now.Add(MaxClockSkew)) {
return nil, ErrTime
}
n := int(inner[9])
if n > MaxBodySize {
return nil, ErrBody
}
for _, b := range inner[10+n : 10+MaxBodySize] {
if b != 0 {
return nil, ErrBody
}
}
Why insist on zero padding when the signature already covers it? Because strict parsing removes whole classes of "two encodings, one meaning" bugs. If non-zero padding were allowed, the same logical event would have many valid byte forms, and every system that hashes events (deduplication, OpenTimestamps) would have to agree on which one counts.
Old timestamps are accepted on purpose: store-and-forward means a real panic can arrive days late. Future timestamps more than 10 minutes ahead are rejected, so a captor cannot pre-sign a week of "I'm safe" check-ins with future dates. Replays of old ones are stopped above this layer, by the watcher's per-sender sequence numbers.
DecodeText is just as strict on the SMS side: the wrong length, any = or any whitespace is rejected, and the SMS transport is responsible for stripping what phones add when they join segments.
The Nostr layer: rumor, seal, gift wrap
The Kengele message is already signed and encrypted. Why wrap it again for Nostr?
Because a plain Nostr event leaks a lot. Every Nostr event has a pubkey (who sent it), a created_at (when), tags (to whom) and a signature. If an activist published their encrypted check-in as a normal event, every relay would see "this key sent something to that key at 14:07, then again at 15:37, then at 17:07". That rhythm alone reveals a watch window, and the sender key links the activist to their guardians.
NIP-59 gift wraps and NIP-17 private messages fix most of this with three layers. internal/transport/nostr/wrap.go builds them:
| Layer | Kind | Signed by | Encrypted to | created_at |
|---|---|---|---|---|
| Rumor | 14 | nobody (unsigned) | β | real time |
| Seal | 13 | the sender's key | recipient (NIP-44) | real time minus random 0β48 h |
| Gift wrap | 1059 | a fresh one-time key | recipient (NIP-44) | real time minus random 0β48 h |
rumor := gn.Event{
Kind: gn.KindDirectMessage, // 14
PubKey: senderPubHex,
CreatedAt: gn.Timestamp(now.Unix()),
Tags: gn.Tags{{"p", recipientHex}},
Content: message.EncodeText(wire), // the 304-character Kengele message
}
rumor.ID = rumor.GetID()
The rumor is unsigned on purpose. If it leaked, it would not be a signed statement anyone could prove the sender made. (The Kengele message inside it is signed, but only a guardian can decrypt that.)
The seal encrypts the rumor to the guardian and is signed with the sender's real key, so the guardian knows who it is from. Its timestamp is moved back by a random amount:
sealAt, err := jitter(now, rnd)
seal := gn.Event{Kind: gn.KindSeal, CreatedAt: sealAt, Tags: gn.Tags{}, Content: sealContent}
if err := seal.Sign(senderSec); err != nil { ... }
The gift wrap encrypts the seal again, this time with a brand-new key generated for this one message, and is signed by that throwaway key:
oneTime := gn.GeneratePrivateKey()
ck2, err := nip44.GenerateConversationKey(recipientHex, oneTime)
wrapContent, err := nip44.Encrypt(seal.String(), ck2)
gw := gn.Event{
Kind: gn.KindGiftWrap, // 1059
CreatedAt: wrapAt, // jittered again, independently
Tags: gn.Tags{{"p", recipientHex}},
Content: wrapContent,
}
if err := gw.Sign(oneTime); err != nil { ... }
A relay sees only the outer layer: a kind 1059 event from a key it has never seen and will never see again, addressed to the guardian, with a timestamp somewhere in the last two days.
The jitter uses crypto/rand, not math/rand, because a predictable jitter is no jitter at all:
func jitter(now time.Time, rnd io.Reader) (gn.Timestamp, error) {
n, err := rand.Int(rnd, big.NewInt(int64(MaxJitter/time.Second)))
if err != nil {
return 0, fmt.Errorf("nostr: jitter: %w", err)
}
return gn.Timestamp(now.Unix() - n.Int64()), nil
}
Wrap also refuses to wrap anything that is not a well-formed Kengele message, so this transport can never be turned into a general channel for leaking other data:
if len(wire) != message.WireSize || wire[0] != message.Version {
return gn.Event{}, fmt.Errorf("nostr: wrap: %w", message.ErrSize)
}
Unwrapping, and the impersonation rule
Unwrap reverses the layers and checks every signature. The most important check is NIP-17's rule that the rumor's author must be the seal's signer:
// NIP-17: the rumor's author must be the seal's signer, or anyone could
// seal a rumor that claims to come from someone else.
if rumor.Kind != gn.KindDirectMessage || rumor.PubKey != seal.PubKey || rumor.Sig != "" {
return nil, sealer, ErrMalformed
}
Without it, Mallory could take any rumor claiming to be from Amina, seal it with Mallory's own key, and the guardian would see "from Amina" in the rumor. With it, the claimed author must match the key that actually signed the seal.
So a guardian checks two signatures on every message: the Nostr seal, and the Kengele event inside, which message.Open verifies. The transport's Receive then drops anything whose sealer is not one of the people this guardian watches over.
Run it yourself: what a relay sees
This example seals a check-in and a panic with made-up keys, gift-wraps both, and prints what a relay would see next to what the guardian sees. Save it as internal/transport/nostr/blog_example_test.go in a clone:
package nostr
import (
"bytes"
"encoding/hex"
"fmt"
"time"
"github.com/altradits/kengele/internal/message"
"github.com/btcsuite/btcd/btcec/v2"
)
func Example_whatARelaySees() {
activist, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0xa1}, 32)) // made-up test keys
guardian, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0xb2}, 32))
gPub := message.PublicKey(guardian)
aPub := message.PublicKey(activist)
now := time.Date(2026, 1, 15, 14, 7, 0, 0, time.UTC)
for i, k := range []message.Kind{message.KindCheckIn, message.KindPanic} {
ev := message.Event{Kind: k, CreatedAt: now, Seq: uint32(i + 1), Body: []byte("Kisumu")}
wire, _ := message.Seal(ev, activist, gPub)
gw, _ := Wrap(wire, activist, gPub, now, nil)
fmt.Printf("%s: wire %d bytes, sms text %d chars\n", k, len(wire), len(message.EncodeText(wire)))
fmt.Printf(" outer kind %d, signed by activist? %v, backdated? %v, content %d chars\n",
gw.Kind, gw.PubKey == hex.EncodeToString(aPub[:]), gw.CreatedAt.Time().Before(now) || gw.CreatedAt.Time().Equal(now), len(gw.Content))
got, sealer, _ := Unwrap(&gw, guardian)
opened, _ := message.Open(got, guardian, [][32]byte{sealer}, now)
fmt.Printf(" guardian opens: %s from activist? %v, body %q\n", opened.Kind, opened.Signer == aPub, opened.Body)
}
// Output:
// check-in: wire 228 bytes, sms text 304 chars
// outer kind 1059, signed by activist? false, backdated? true, content 2140 chars
// guardian opens: check-in from activist? true, body "Kisumu"
// panic: wire 228 bytes, sms text 304 chars
// outer kind 1059, signed by activist? false, backdated? true, content 2140 chars
// guardian opens: panic from activist? true, body "Kisumu"
}
git clone https://github.com/altradits/kengele
cd kengele
# save the file above as internal/transport/nostr/blog_example_test.go
go test -run Example_whatARelaySees -v ./internal/transport/nostr
Our output (Go 1.26.5):
check-in: wire 228 bytes, sms text 304 chars
outer kind 1059, signed by activist? false, backdated? true, content 2140 chars
guardian opens: check-in from activist? true, body "Kisumu"
panic: wire 228 bytes, sms text 304 chars
outer kind 1059, signed by activist? false, backdated? true, content 2140 chars
guardian opens: panic from activist? true, body "Kisumu"
The two lines in the middle are the whole point. To the relay, the check-in and the panic are the same kind, the same size (2,140 characters of ciphertext), signed by unrelated throwaway keys, at unrelated times. Only the guardian's key turns one of them into "panic".
Test vectors, so other implementations agree
An Android app (Kotlin) and a Go watcher must produce and accept exactly the same bytes. So the format ships a golden vector with made-up keys: activist key 0xa1 Γ 32, guardian key 0xb2 Γ 32, nonce 0x01 Γ 32, a check-in at 2026-01-15 14:07 UTC, seq 1, body Kisumu. TestGoldenVector checks the exact 304-character output, and TestNIP44OfficialVector checks the NIP-44 library against the first vector in the specification itself, so a regression in the dependency would be caught here too.
go test -count=1 -v ./internal/message
--- PASS: TestRoundTripEveryKind (0.04s)
--- PASS: TestSealAllOpensForEachGuardian (0.00s)
--- PASS: TestSMSTextFitsTwoSegments (0.00s)
--- PASS: TestEveryKindHasTheSameLength (0.01s)
--- PASS: TestRejects (0.01s)
--- PASS: TestNIP44OfficialVector (0.00s)
--- PASS: TestGoldenVector (0.00s)
--- PASS: TestSharedVectorsFormat (0.00s)
--- PASS: TestSharedVectorsGolden (0.00s)
--- PASS: TestSharedVectorsNIP44 (0.00s)
--- PASS: TestSharedVectorsChaCha20 (0.00s)
ok github.com/altradits/kengele/internal/message 0.353s
TestEveryKindHasTheSameLength is goal 3 as a test.
Sending through outages
The transport in transport.go adds the reliability layer:
-
Publish everywhere.
Sendpublishes the same gift wrap to every configured relay in parallel, plus the guardian's inbox relays (a signed kind 10050 list) if known. -
Only an explicit
OK truecounts. A timeout or a dropped connection is not acceptance. -
Outbox on failure. If fewer than
MinAcceptedrelays accept (default 1), the wrap goes to an outbox andSendreportsQueued.Runretries with backoff from 5 seconds to 5 minutes, republishing the same gift wrap only to relays that have not accepted it yet. - Look back 48 hours. Because wraps are backdated by up to two days, every subscription asks for events that far back from the last time it was connected. Otherwise a message sent during an outage, then backdated, would fall outside the window and be missed.
- Deliver once. Receive remembers recent gift-wrap IDs and message hashes (10,000 by default), so a message carried by five relays, or re-wrapped by the sender, reaches the watcher once.
-
Report connectivity. After every publish round, and whenever a receive connection opens or drops, the transport reports
Status{Reachable, Total, At}. That is the signal the deadline engine uses to tell "the activist went quiet" from "we cannot reach any relay".
One implementation note: the relay client is a small NIP-01 client written on github.com/coder/websocket, not go-nostr's Relay. In go-nostr v0.52.3, Relay.Close raced with its own goroutines under go test -race, and Publish could report success if the connection dropped before the relay answered. For a tool where "sent" must mean sent, both were disqualifying. go-nostr is still used for events, signatures, NIP-44 and envelopes.
go test -race -count=1 -v ./internal/transport/nostr
--- PASS: TestWrapUnwrapRoundTrip (0.01s)
--- PASS: TestOuterEventHidesSenderTimeAndContent (0.05s)
--- PASS: TestUnwrapRejects (0.00s)
--- PASS: TestActivistToGuardiansOverRelays (0.62s)
--- PASS: TestDuplicateSuppression (0.42s)
--- PASS: TestPartialAcceptance (0.01s)
--- PASS: TestOutageQueuesThenRetryAfterReconnect (0.17s)
--- PASS: TestReceiveReconnects (0.10s)
--- PASS: TestUnknownSenderDropped (0.42s)
--- PASS: TestInboxRelayList (0.00s)
--- PASS: TestSeenSetEvicts (0.00s)
ok github.com/altradits/kengele/internal/transport/nostr 2.427s
Kengele ships no default relays. The activist and guardians choose at least three, run by different operators in different countries, ideally outside the country whose government is the threat. Nobody, including us, needs to run a relay for Kengele to work.
What a carrier can still see
Encryption hides content and kind. It does not hide everything, and the docs list what leaks:
- That a message was sent, when it reached the relay, and its size (always the same, so the size itself reveals nothing).
-
The recipient's key in the gift wrap's
ptag, needed for delivery. Guardians should use a key made only for Kengele, never their everyday Nostr identity, so it does not link to a public profile. - IP addresses of whoever publishes or subscribes, unless they use Tor or a VPN.
-
Rhythm. The
created_atis randomised, but the relay's own receive time is not. During a watch window, a relay could see a regular pattern of wraps to one key every 90 minutes. - Over SMS, phone numbers and timing. That is why SMS is opt-in per activist.
Open questions we would love help with
-
Constant-time MAC check. The NIP-44 library in go-nostr v0.52.3 compares the MAC with
bytes.Equal, not a constant-time compare. Over SMS this is hard to exploit, but it should be fixed upstream, not worked around here. - Trying every sender. Fine for a family; an organisation watching hundreds may need a recipient hint, which leaks a little.
- Cover traffic. Should check-ins be sent with a random delay, or with dummy traffic, to hide the watch-window rhythm?
- A persistent, encrypted outbox. Today it lives in memory, so a phone restart loses queued messages. How to store it without leaving something to find on a seized phone is a threat-model question.
- NIP-42 relay auth. Some inbox relays only serve kind 1059 to the authenticated recipient. Not supported yet.
How to help
Kengele is free, MIT-licensed and not for real use yet. We are open to collaboration, guidance and any form of participation:
-
Nostr developers: review
wrap.goandclient.goagainst NIP-01, NIP-17, NIP-44 and NIP-59. Tell us what we got wrong. - Cryptographers: the message format is small enough to review in an afternoon. Break it.
- Kotlin developers: implement the format against the shared test vectors so the Android app and the Go watcher can never disagree.
- Anyone who works with activists: tell us what the threat model is missing.
Start with CONTRIBUTING.md. Report security issues privately as described in SECURITY.md.
Not sponsored. Every life is worth watching over. Look out for each other.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.