# PIECE 3 ACCESS/RTC FINAL REPORT

## 1. Executive Result

All Piece-3 consensus, access-provider, migration, Web Push, decentralized
service discovery, matcher, and relay gates pass. Piece 4 has not begun. The
remaining concerns are development-environment limitations, not failed Piece-3
requirements.

## 2. Commit

Branch: `piece3/network-consensus`

Verified implementation commit: `92b40e1345c8c41c455ec5077e4cdc7063d5aca0`

## 3. SDD v1.6 Hash

`spec/design/SDD-StateChain-DID-v1.6.html`

SHA-256: `19f97638c395ce196d9dff6da03d4260860756973194ab1b567be1145ad199d9`

## 4. Certbot Upgrade

The Debian Certbot 4.0.0 client was replaced by pip-installed Certbot 5.7.0.
The supported `--ip-address` and short-lived profile flow was used after a
successful staging issuance.

## 5. Trusted Raw-IP Certificate

Let's Encrypt issuer `YE1` issued the production certificate with critical SAN
`IP Address:159.195.197.243`. It is valid from 17 August through 24 August 2026.
Nginx serves it without a trust override.

## 6. Renewal Dry Run

`certbot renew --dry-run` passes. The deploy hook validates/reloads Nginx,
refreshes coturn certificate copies, and restarts both relay processes.

## 7. Browser Web Push Evidence

Chrome WebDriver under a real headed X display passes PWA load, service-worker
registration, notification permission, PushSubscription creation,
authenticated upload, VAPID send, generic notification, and service-worker
receipt. Provider A and B use distinct VAPID keys and origins. Gone
subscriptions, VAPID mismatch, missing PUSH scope, revoked grants, transient
retry, access-service restart persistence, and fresh worker execution pass.
Default notifications contain no DCode value.

## 8. Access Handoff Evidence

`AccessProviderHandoffV1` verifies the `statechain/access-handoff/v1` signature
against the current DID key in the ACTIVE finalized devnet registry. Provider,
grant, DID, action, timestamp, and expiry bindings are enforced. Forged,
expired, future, mismatched, and malformed envelopes fail closed.

## 9. Cleanup Receipt and Idempotency

`ProviderCleanupReceiptV1` is signed by the separate access-service identity.
The tested sequence is `COMPLETE`, `ALREADY_CLEAN`, `ALREADY_CLEAN`; receipt
signatures verify, sessions/grants are rejected afterward, and no state is
recreated.

## 10. Provider-A Offline Retry

With Provider A stopped, Provider B creates a new grant/session, imports the
watches, restores SCMIG1, and remains usable. B stores only the already signed
handoff. After A restarts, retry succeeds, A cleans its state, B receives the
signed receipt, and the queued envelope is deleted.

## 11. Full A-to-B Browser Migration

Two trusted origins pass the complete harness: Provider-A wallet/address book,
grant/session, three watches and origin-bound push; SCMIG1 export/restore;
Provider-B grant, DID binding, distinct PushSubscription, three imported
watches, signed handoff, A cleanup, and receipt. B pushes after a watched event;
A push is suppressed after cleanup. The B database contains no wallet private
key.

## 12. Service Advertisement

`NodeServiceAdvertisementV1` binds the actual ACTIVE registry-record hash,
provider node ID, finalized root, services, endpoints, 600-second TTL, and
service public keys. Its node signature verifies against the registry node key.
The cleanup/service key remains separate.

## 13. Decentralized Service Directory

`GET /services/snapshot` and TLS `WS /services/stream` are live. Two independent
provider processes return compatible independently verifiable service sets.
Forged, expired, wrong-registry, and inactive-provider policy checks fail
closed; the aggregator is not authority.

## 14. RTC Matcher

Two advertised matcher identities accept bounded `RtcLobbyIntentV1` objects and
issue signed `RtcMatchAssignmentV1` objects using finalized-header randomness.
Malformed and oversized signaling is rejected.

## 15. Matcher Failover

Both matcher processes return the same deterministic primary/backup ordering.
With matcher A stopped, matcher B verifies the intent and supplies the signed
assignment for deterministic backup selection.

## 16. Coturn Profile

Two coturn 4.6.1 processes use separate identities, configs, REST secrets,
ports, relay ranges, and system services. They support UDP/TCP/TLS, disable
anonymous allocation, reject loopback/multicast peers, cap each user at eight
allocations and total capacity at 64, cap sessions at 1 MiB/s, and cap each
relay at 64 MiB/s aggregate.

## 17. TURN Credential Broker

The broker is access-scoped and requires an unexpired signed match assignment
owned by the requesting grant. It returns relay-specific REST-HMAC credentials
valid for 600 seconds. Wrong-participant, anonymous, stale-assignment, bypass,
quota-overflow, and expired-credential tests fail closed.

## 18. Direct ICE Result

Two real Chrome peers receive STUN and TURN configuration, select `host/host`
candidates, and pass the bidirectional data channel. TURN is not selected.

## 19. Forced TURN Result

With `iceTransportPolicy=relay`, Chrome selects `relay/relay` candidates through
coturn and passes the bidirectional data channel using a 600-second credential.

## 20. Alternate Relay Result

Relay B independently passes `relay/relay`. With relay A stopped, relay B still
establishes the bidirectional browser data channel. Both relays currently share
one physical development host.

## 21. Cloudflare-Disabled Result

No Cloudflare TURN endpoint or secret appears in discovery, matcher, broker, or
browser acceptance configuration. Direct ICE and both relay paths pass without
Cloudflare.

## 22. Security

Forged/stale assignments, wrong-participant broker calls, broker bypass,
anonymous TURN, expired credentials, quota overflow, forged advertisements,
oversized/malformed signaling, VAPID mismatch, and revoked access fail closed.
The repository relay-secret scan passes. Provider-local services never sign a
consensus transaction and never custody wallet keys.

## 23. Piece-1/2/3 Regression

The complete Rust workspace suite passes, covering Piece 1 and Piece 2 core,
privacy, storage, codec, property, failure, and security regressions. Piece-3
crypto, P3 gates, seven-node encrypted consensus, fault rehearsal, SCMIG1,
handoff, push, matcher, directory, broker, direct ICE, forced TURN, alternate
relay, and service-health tests pass. Seven nodes converge on one finalized
header and state root.

## 24. Remaining Piece-4 Work

Piece 4 may integrate the production e-mint lobby, liveness prompts, consent,
peer acknowledgements, seasonal nullifiers, mint authorization, and audit
sampling. Production deployment should replace the sslip.io browser-test names,
host relays on distinct infrastructure, and freeze the production external
service signature/rotation ceremony.

PIECE 3 FINALIZED — READY FOR PIECE 4 WITH NON-BLOCKING CONCERNS
