Repository navigation
Done
Labels
bugSomething isn't working
Description
From a re-audit of main at bd39ce8. Context: src/sidestr/core.js:76 refuses any chain whose parent is a mainnet, so only test coins are exposed today. These should be closed before that gate is lifted.
What holds: signing is structured, not blind. The window rebuilds the UTXO set itself, discards the page's witness and computes the sighashes locally; the origin comes from Chrome's sender; trusted-origin and auto-sign settings never skip the window; and a spend digest cannot be confused with a Nostr event or NIP-98 signature.
- Sats paid into an asset-record output are burnt with no warning. An
OP_RETURNwhose text matchesissue:,tally:orpool:is classedasset-recordwhatever its value (src/sidestr/core.js:235). Burn warnings fire only forburnandpegout(src/sidestr/core.js:251-254), the window leavesasset-recordout of the "Sending" list (popup/spend.js:135), and the details pane shows the record's text but not its value (popup/spend.js:189,:200). Reproduced: a transaction paying 1,000 sats to a recipient plus a record output carrying 998,000 showed "Sending: 1,000 sats", a normal fee and no warning. The only clue is that "Total leaving" exceeds sending plus fee. Fix: inreview(), treat anyOP_RETURNwith value > 0 as a burn (warn, require the tick-box) and list it under "Sending" with its amount. - The opt-in is checked only in the window (
popup/spend.js:305-313), not inspends.request(src/sidestr/spends.js:453-469). A page can open spend windows without limit while spends are off. Fix: check the setting in the service worker and fail fast; allow one pending spend per origin. - First-spend pinning trusts the highest claimed tip (
vendor/sidestrannounce.mjs:37,:61-66;src/sidestr/core.js:62;popup/spend.js:220). On a chain's first spend, whichever key announces the highest tip is used and then pinned. A lie about sat amounts fails safe, because the sighash commits to them; a lie about asset carries does not, and the real chain is then locked out. Fix: show the full signer key prominently on first spend, and refuse an announcement whose claimed tip has no matching header. - The vendored engine uses its own SHA-256 and BIP340 verify (
vendor/sidestr/schema/codec/hash.js,secp256k1.js:155-175). That SHA-256 computes the digest the key signs. The engine already exposessetSha256Backendand a verify backend; nothing insrc/orpopup/sets them. Best changed upstream in@sidestr/specand re-vendored, with BIP340/BIP341 vectors. - Mirror URL is whatever the announcement says (
announce.mjs:52-54,explorer.mjs:67,:74,:79), fetched with<all_urls>privileges, including local-network hosts. Fix: requirehttps:and refuse private and loopback hosts. - Display. A recipient's self-chosen profile name becomes the payee headline (
popup/spend.js:105,:163); record and peg-out text is not stripped of bidi and control characters (popup/spend.js:148-152,:200). - No spending caps exist, per transaction or per day. Worth deciding before mainnet.
-
SIDESTR_SIGN_DIGESTSsigns any 32-byte digests for an extension page holding a live request id (src/sidestr/spends.js:479-487); checking the digest count against the input count is a cheap guard.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
jjohare commentedon Nov 28, 2026
Addressed in 0.0.13 (a2265b7): any OP_RETURN carrying value is a burn and is listed; the opt-in is enforced in the service worker with one pending spend per site; the first spend shows the full signer key and refuses a tip the mirror does not hold; the engine's SHA-256 and signature checks use the noble libraries; mirror URLs must be public https; hidden and bidi characters are stripped and a self-chosen name is no longer the headline; the digest count must equal the input count. Spending caps are #46; the rest is in #47.