Status: Accepted
Date: 2026-03-28
Commit: bb8aee7
In did:btcr2, a beacon is how a DID controller announces updates to their DID document on-chain. The protocol supports three distinct shapes: each with different trust, throughput, and resolution-complexity trade-offs:
Before this landed, the codebase had an earlier experiment where beacon types were modeled as configuration flags on a single class. That made the factory logic gnarly (many if (type === 'x') branches) and obscured the fundamentally different resolution paths each type implies.
Beacon class. Lowest file count; highest per-type branching at every call site.broadcastSignal() / processSignals() methods each type needs.Beacon base + three concrete subclasses + a factory.Option 3. Beacon is an abstract base class encoding the common contract (fee estimation, PSBT construction, signal broadcast). Three concrete subclasses: SingletonBeacon, CASBeacon, SMTBeacon: implement their type-specific behavior. BeaconFactory.establish(service) dispatches on the service record to instantiate the correct subclass.
Each subclass owns:
broadcastSignal(): Singleton signs directly; CAS invokes an optional casPublish callback for off-chain; SMT builds a single-entry Merkle tree as a trivial root.processSignals(): returns BeaconProcessResult = { updates, needs } with the type-appropriate DataNeed emissions. Singleton emits NeedSignedUpdate; CAS emits NeedCASAnnouncement; SMT emits NeedSMTProof.Aggregate beacons (CAS, SMT) ship a second multi-party path via the AggregationService subsystem (ADR 020).
Positive
processSignals implementation. Future contributors find the right file by DID-document service type.Negative
packages/method/src/core/beacon/beacon.ts: abstract base.packages/method/src/core/beacon/factory.ts: dispatch.packages/method/src/core/beacon/singleton-beacon.ts,
cas-beacon.ts,
smt-beacon.ts.