Skip to content
6 changes: 3 additions & 3 deletions Documentation/Compatibility/Rulings.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ behind the general rule.
| COMP-050 | Go wallet-wire processors return malformed requests as transport errors and pass the originator to each wallet method; `@bsv/sdk` 4.1.1 answers every failure in-band. | Swift provides bounded transport-neutral processors and transceivers with a required originator authorizer. Every processor failure, including unknown calls and malformed requests, is an error frame with the TypeScript message. | A TypeScript transceiver must see an error frame, not a dead transport, and must be able to fall back after the call-29 probe. See [COMP-050](Rulings/COMP-050-Wallet-Wire-Substrates.md). |
| COMP-051 | Go's interpreter debugger stores mutable callback lists and clones mutable VM state; its declared rewind option is unimplemented. | Swift uses an opt-in bounded immutable `Sendable` event stream, redacts descriptions/reflection, and omits rewind. | Preserves deterministic lifecycle observability without exposing mutable execution state or creating callback races. |
| COMP-052 | Pinned Go auth accepts variable nonce lengths, can lose random-source failures, authenticates an unsigned initial request, and does not enforce the expected peer identity. BRC-103 uses version `0.1`, while some BRC-104 material shows `1.0`. | Swift emits and accepts BRC-103 version `0.1`, accepts 32-byte nonces and the exact 48-byte Go form, propagates random failures, binds the expected peer, and authenticates a responder only after a signed general message. The transport-neutral BRC-104 payload has no separate version field. | Canonical shared messages and payloads remain interoperable. Strict JSON, low-S DER, replay checks, cancellation, session limits, and payload limits prevent the pinned defects and ambiguous input from entering session state. |
| COMP-053 | Go combines overlay values with HTTP facilitators, mutable resolver defaults, wallet-backed admin tokens, and `any`-typed lookup values. | `BSVOverlay` provides only bounded SHIP/SLAP values and transport-neutral async facilitator protocols with typed byte payloads. | Preserves useful Go vocabulary without accepting unbounded data, hidden network policy, or mutable or erased result state. |
| COMP-053 | Go combines overlay values with HTTP facilitators, mutable resolver defaults, wallet-backed admin tokens, and `any`-typed lookup values. | `BSVOverlay` provides only bounded SHIP/SLAP values and transport-neutral async facilitator protocols with typed byte payloads. Topic and service names follow the `@bsv/sdk` 4.1.1 grammar, and lookup outputs carry the optional TS `context` and `txid`. | Preserves useful Go vocabulary without accepting unbounded data, hidden network policy, or mutable or erased result state. |
| COMP-054 | Pinned Go identity creates fallback wallets and concrete network broadcasters, discards a disclosure verifier secret, emits raw key bytes as display text, and exports an accepting verifier. TypeScript 4.1.1 and `tm_identity` require `[1,"identity"]` and the fixed "anyone" verifier. | `BSVIdentity` requires typed wallet, broadcaster, and bounded limits; proves to the "anyone" verifier; locks under `[1,"identity"]` by default; emits canonical compressed-key hex; verifies certificates; and checks the proved keyring exactly. | Produces tokens TypeScript overlay hosts admit, without copying unsafe capability and encoding defects. |
| COMP-055 | Pinned Go registry combines mutable clients, factory setters, default network state, wallet orchestration, HTTP overlay discovery, and an open definition interface. TypeScript 4.1.1 tokens carry an operator signature and use level-1 protocols. | `BSVRegistry` provides bounded immutable definition values, the TypeScript signed 7/7/8-field PushDrop codec with operator key linkage, typed records and queries, plus narrow `Sendable` lookup and publisher boundaries. | Reads and writes the tokens TypeScript hosts admit without hidden transport, wallet orchestration, persistence, mutable state, or erased values. |
| COMP-056 | Pinned Go KVStore combines PushDrop token encoding with wallet actions, BEEF state resolution, encryption, mutable local state, and undocumented output ordering. Go writes one field; TypeScript 4.1.1 `LocalKVStore` requires two (value and signature). | `BSVKVStore` provides bounded immutable two-field signed tokens and locators in the lock-before layout, with wallet signing and owner-key checks. | Matches the token TypeScript reads without claiming storage, ordering, encryption, persistence, or transport semantics. |
| COMP-057 | Pinned Go storage combines UHRP value conversion with unbounded overlay resolution, downloader HTTP, authenticated upload APIs, mutable HTTP clients, and type-erased service data. | `BSVStorage` provides bounded UHRP identifiers, content values, signed host-advertisement decoding, and a narrow `Sendable` content-provider boundary. | Preserves the UHRP Base58Check and SHA-256 format and the TypeScript advertisement layout without embedding HTTP policy, discovery, wallet authority, persistence, or erased response state. |
| COMP-058 | Pinned Go treats an overlay administration token as a mutable wallet template, accepts surplus or malformed data fields, and does not verify its appended signature before discovery uses it. | `BSVOverlay` decodes only bounded, exact signed `beforeCompatibility` PushDrop advertisements and verifies the signature against the locking key. Wallet construction and spending remain separate. | Preserves signed SHIP/SLAP advertisement data without importing wallet orchestration, default resolvers, HTTP policy, or mutable factories. |
| COMP-058 | Pinned Go treats an overlay administration token as a mutable wallet template, accepts surplus or malformed data fields, and does not verify its appended signature before discovery uses it. | `BSVOverlay` decodes only bounded, exact signed `beforeCompatibility` PushDrop advertisements and verifies the signature against the locking key, which must be the identity's BRC-42 SHIP or SLAP child as in `@bsv/sdk` 4.1.1. URI, field-size, and DER rules also match TS. Wallet construction and spending remain separate. | Preserves signed SHIP/SLAP advertisement data without importing wallet orchestration, default resolvers, HTTP policy, or mutable factories. |
| COMP-059 | Pinned Go joins BRC-104 HTTP framing to concrete clients, callback state, unauthenticated fallback, and automatic payment. | Swift provides a bounded transport-neutral HTTP frame codec for signed general messages. It requires canonical authentication headers and exact request-ID correlation. | Preserves the authenticated HTTP wire fields without selecting endpoint, retry, fallback, payment, or persistence policy. The unsigned requested-certificate header remains rejected; signed exchange uses COMP-060. |
| COMP-060 | Pinned Go certificate exchange does not enforce requested field or type completeness, does not correlate a response with one pending request, and carries an unsigned requested-certificate HTTP header. | Swift provides bounded typed post-authentication certificate requests and responses. It signs canonical request or response JSON, correlates one exact pending request, and requires separate BRC-52 certificate validation. The HTTP header remains rejected. | Canonical signed BRC-103 messages remain compatible. Swift does not accept missing disclosures, unsolicited responses, or unsigned HTTP certificate requests. |
| COMP-061 | Pinned Go overlay HTTP and policy use unbounded response reads, unsafe binary counts and indexes, default trackers, unbounded fan-out, and scheduler-dependent result order. | Swift places bounded HTTPS facilitators in `BSVNetwork` and deterministic resolver and one-shot broadcaster policy in `BSVOverlay`. All hosts and limits are explicit, discovery verifies signed tokens, and failed submission has uncertain delivery. | Preserves canonical SHIP and SLAP requests and results without hidden network policy, unsafe retry, unbounded work, or nondeterministic aggregation. |
| COMP-061 | Pinned Go overlay HTTP and policy use unbounded response reads, unsafe binary counts and indexes, default trackers, unbounded fan-out, and scheduler-dependent result order. | Swift places bounded HTTPS facilitators in `BSVNetwork` and deterministic resolver and one-shot broadcaster policy in `BSVOverlay`. All hosts and limits are explicit, discovery verifies signed tokens, and failed submission has uncertain delivery. The wire formats (aggregated answers, JSON outputs, camelCase STEAK, comma-separated topics, off-chain values, any 2xx) and per-host topics follow `@bsv/sdk` 4.1.1 hosts. | Preserves canonical SHIP and SLAP requests and results without hidden network policy, unsafe retry, unbounded work, or nondeterministic aggregation. |
| COMP-062 | Pinned Go provides one concrete UHRP downloader with internal resolver, tracker, and HTTP policy. | Swift keeps UHRP values in `BSVStorage` and places the injected resolver and bounded HTTPS downloader in `BSVNetwork`. It authenticates the signed six-field TypeScript advertisement, binds it to the requested hash, sorts hosts, makes one GET per host, and verifies the SHA-256 result. | Preserves the TypeScript `ls_uhrp` query and advertisement layout without hidden trackers, cleartext hosts, unbounded bodies, automatic retry, or mutable network policy. |
| COMP-063 | BRC-157 composes BIP-39, BIP-32, and BRC-140 without storage, transport, or a concrete wallet implementation. Go and TypeScript expose the constituent behavior from their SDK packages. | Swift places the composed entropy-backup and hardened-profile API in opt-in `BSVCompat`, which already owns BIP-39 and BIP-32 and depends on `BSVKeys` for BRC-140. It remains outside the modern `BSV` umbrella. | Keeps the reusable backup primitive in the SDK while preserving the explicit compatibility boundary required by BIP-39 and BIP-32. Toolbox wallets may consume it without owning or duplicating the primitive. |
| COMP-064 | The interpreter was pinned to Go v1.3.3. TypeScript `@bsv/sdk` 4.1.1 and Go disagree with it on Chronicle splice operands, numeric shifts, the Chronicle number limit (32,000,000 bytes, not 32 MiB), `SIGHASH_CHRONICLE`, malleability relaxation for transaction version above 1, alt-stack clearing, signature and public-key checks, structural-only DER, and the bound on arithmetic results. | Swift follows SV Node v1.2.3 for all of them. It adds `ScriptVerificationFlags.chronicle`, implied by the `.afterChronicle` era, and the consensus failures `illegalChronicle` and `scriptNumberOverflow`. | Script validity is consensus, so the node decides. With `.enableForkID` a signature without the ForkID bit is rejected, and callers must pass `.chronicle` themselves for older outputs spent after Chronicle activation. Where Go differs, Swift no longer matches Go. `NodeConformanceRegressionTests` runs all 21 TypeScript node vectors and a test per rule. See [COMP-064](Rulings/COMP-064-Interpreter-Node-Chronicle-Rules.md). |
Expand Down
13 changes: 13 additions & 0 deletions Documentation/Compatibility/Rulings/COMP-053-Overlay-Core.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ limit.
This core packet added no wire codec. COMP-061 adds the bounded HTTP formats,
deterministic resolver, and one-shot broadcaster without changing these core
value rules.

## @bsv/sdk 4.1.1 alignment

Live overlay hosts run `@bsv/sdk` 4.1.1 (ts-stack `3b1abc569`). These core rules
now follow it:

- Topic and service names use the `@bsv/sdk` grammar (`overlay-tools/OverlayNames.ts`):
`tm_` or `ls_`, then lowercase ASCII letters and digits in segments joined by
single underscores, 256 bytes at most. The earlier rule allowed uppercase,
repeated or trailing underscores, and longer names that TS hosts reject.
- A lookup output may carry the optional `context` bytes and `txid` that TS
hosts return. `OverlayLimits.maximumLookupContextByteCount` (1 MiB by default)
bounds each context, and the aggregate answer limit counts context bytes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,42 @@ Swift does not select HTTP endpoints, trackers, retry policy, resolver hosts,
or a wallet capability. It also does not provide a partial unsigned token
constructor. Later construction and spending work must use explicit wallet
capabilities and preserve the verified four-field signing payload.

## @bsv/sdk 4.1.1 alignment

Verification now matches `OverlayAdminTokenTemplate.ts:159-222`, which is what
live discovery applies:

- The PushDrop locking key must be the BRC-42 child of the advertised identity
key for invoice `2-service host interconnect-1` (SHIP) or
`2-service lookup availability-1` (SLAP), with the "anyone" key (scalar 1)
as counterparty. The signature must verify under that derived key. A key that
is not derived from the identity no longer authenticates the identity, so a
forged advertisement cannot claim another operator's identity. A correctly
signed token whose locking key belongs to another identity throws
`unlinkedLockingKey`. Legacy advertisements signed with a self-derived key
fail with `invalidSignature`, as they do in TS.
- The identity key must be canonical compressed (`02` or `03`).
- Each field is at most 4096 bytes and all five together at most 8192 bytes.
- The signature field is 8 to 80 bytes of canonical DER.
- The host field must be an advertisement URI TS accepts: an `https`,
`https+bsvauth`, `https+bsvauth+smf`, `https+bsvauth+scrypt-offchain` or
`https+rtt` origin, a `wss` URL, or a `js8c+bsvauth+smf` coordinate URI.
Localhost, punycode labels, credentials, fragments, and control characters
are rejected.
- Hosts are parsed as the WHATWG URL parser in TS parses them. A host that
ends in a number must be a valid IPv4 address in one of the WHATWG forms
(`2130706433`, `0x7f.1`, `1.2.3`, octal parts), and is written as a dotted
quad, so `https://2130706433/` is the origin `https://127.0.0.1`. Hosts such
as `1.2.3.4.5`, `256.1.1.1` and `a.b.c.1` are rejected. Bracketed IPv6 hosts
are validated and written in canonical form (`[0:0:0:0:0:0:0:1]` is `[::1]`).
Before this, Swift kept those hosts as written, so one address under two
spellings was two hosts, and malformed IP hosts that TS rejects were accepted.
- Swift accepts nothing TS rejects. It rejects a few forms the WHATWG parser
repairs and no advertisement writer emits: percent-encoded or non-ASCII host
text (TS applies IDNA), any `@` in the authority, backslashes, dot segments
or other text in a path that must be `/`, extra slashes after the scheme, and
leading or trailing spaces.

Discovery (COMP-061) also requires the advertising output to hold exactly one
satoshi, as `LookupResolver.ts` and `SHIPBroadcaster.ts` do.
Loading
Loading