Adds TrustTransport as the third interface on the shared NostrConnection, completing the social-layer happy path in the spike: - WebOfTrust: pure, Flutter-free Duniter membership rule (N certs from members + within distance D of bootstrap referents), iterated to a fixpoint. The commons_core-worthy piece; TDD'd (threshold, distance cutoff, transitive growth, expired/revoked/self exclusion). - NostrTrustTransport: certifications as a custom addressable kind (30777, keyed by issuer+subject) — certify renews, revoke replaces, certs expire. - Trust filters spam (network-trust §2): seeds certify Alice; Eve stays uncertified; Bob discovers both offers and annotates authors — Alice known, Eve unknown — all over ONE shared connection. Findings updated: WoT risk High -> Medium (policy/bootstrap, not feasibility); overall scope Medium-High -> Medium — all three transport contracts now proven. 30 tests green, analyzer clean, Block 1 untouched.
28 lines
1.2 KiB
Dart
28 lines
1.2 KiB
Dart
import 'web_of_trust.dart';
|
|
|
|
/// The third interface over the shared `NostrConnection` (Q2): the web of trust.
|
|
/// Its verbs — certify / revoke / read certifications — are again distinct from
|
|
/// offers and messaging, confirming the three-contract split. Certifications are
|
|
/// public signed events (like the on-chain Ğ1 WoT), so this transport publishes
|
|
/// and discovers rather than encrypts.
|
|
abstract interface class TrustTransport {
|
|
/// Publishes a signed "I vouch for [subjectPubkey]" certification, valid for
|
|
/// [validity] (Duniter certifications expire and must be renewed).
|
|
Future<void> certify({
|
|
required String subjectPubkey,
|
|
Duration validity = const Duration(days: 365),
|
|
String note = '',
|
|
});
|
|
|
|
/// Revokes this identity's certification of [subjectPubkey] (replaces the
|
|
/// addressable event with a revoked one).
|
|
Future<void> revoke({required String subjectPubkey});
|
|
|
|
/// All certifications currently visible on the relay (to build a [WebOfTrust]).
|
|
Future<List<Certification>> allCertifications();
|
|
|
|
/// Distinct, currently-valid certifiers of [subjectPubkey].
|
|
Future<Set<String>> certifiersOf(String subjectPubkey);
|
|
|
|
Future<void> close();
|
|
}
|