Status: design reviewed, partly implemented. It changes what the signing screen accepts as input and what the app agrees to sign, so it went through a security design review before anything is built. The outcome and the changes it required are in Section 14. The API change in Section 3.1, signer normalization as the first transaction of a multisig close, is built (INV-51). The two engine changes of check 7.3g are built in the SDK’srunClose(INV-52). The artifact parser (apps/web/lib/cosign/artifact.ts), the station at/cosign(apps/web/lib/cosign/station-checks.ts) and the hub’s export and merge (apps/web/lib/cosign/merge.ts, wired inapps/web/hooks/useCloseExecution.ts) are built.
1. Summary
Today only signers present in one browser session can sign a multisig close. When a transaction stops short of its signing weight, the close engine raisesInsufficientSignatureWeightError and
apps/web/hooks/useCloseExecution.ts keeps the partly signed envelope in pendingRoundRef, in memory. The
next signer must connect in the same browser, and a reload loses the envelope.
This design lets a cosigner on another device sign the same transaction, with these properties:
- The initiator’s browser (the hub) stays the only owner of the close: the plan, the rounds, the mediator and fee-bump preparation, submission, reconciliation by hash and the unconfirmed-submission hold. The initiator holds the account’s master key (Section 3.1).
- A cosigner’s browser runs a cosign station: a LumenWipe page that verifies one transaction, signs it, and hands back signatures only. It never submits and keeps nothing.
- Devices exchange an artifact: a small, strict JSON document that carries one transaction envelope. Every device treats a received artifact as untrusted input.
- No transaction is built in the browser. The web only parses, verifies, signs and submits what the API built (INV-18 in the invariant register).
- No server relays, stores or forwards envelopes or signatures.
- Nothing changes for a close signed in one browser.
2. Protocol facts this design relies on
Facts from this codebase that also shape the design:
- The API builds every close transaction with an upper time bound 300 seconds after the build
(
TX_TIMEOUT_SECONDSinapps/api/src/config/constants.ts).verify()refuses a transaction with no upper bound or one valid more than 15 minutes ahead (INV-32). The mediator and fee-bump sponsor sign only an envelope that has not expired and expires within 330 seconds (MAX_SIGNED_VALIDITY_SECONDS, which isTX_TIMEOUT_SECONDS + 30, INV-38). One API submission is bounded bySUBMIT_BUDGET_MS, 35 seconds. - The close engine verifies a transaction once, before its first signature, and does not verify a resumed
transaction again (
packages/sdk/src/close-engine.ts). That is sound in one session. A second device has no memory of that verification, so it must runverify()itself. - A multisig close needs the full signing weight on one transaction only. When no single key of the account
reaches every threshold (
normalizesSignersFirstinapps/api/src/lib/stellar/tx-builder/index.ts), the first round ofbuildCloseTransactionsis signer normalization alone: the signer removals and the threshold reset, ahead of the exit, token, conversion and claim rounds, and never fused with the merge or with asset handling. Every later transaction needs only the master key. Before this change normalization shared a transaction with the asset handling, and every round before it needed the full weight.
3. Model: one hub, stateless stations
The hub keeps the paused round exactly as today, inpendingRoundRef. For a transaction that needs weight
from a key on another device, it exports a request artifact. A station verifies the request, signs it,
and exports a response artifact that carries only the signatures it added. The hub takes those
signatures, never the envelope body, merges a minimal set of them onto its own envelope, and resumes the
round. Several stations can sign the same request at the same time.
Alternative rejected: a chain, where the envelope passes from device to device and the last one submits.
It would split reconciliation by hash (INV-45, INV-46) and the continuation into the next round across
devices, and it would hand cosigners an envelope that other people’s signatures had made ready to submit.
3.1 Which transactions are cosigned in v1
Decision: for a multisig close, the API emits signer normalization as its own first transaction, before any exit, token, conversion or claim round, and never fuses it with the merge. That transaction is the only one a station signs in v1. After it is confirmed, the master key alone signs the rest of the close on the hub, so the initiator must hold the master key. This API change ships before the station, and is built (INV-51). It applies when the master key carries weight and no single ed25519 key reaches the highest of the three thresholds; a close one key can sign keeps its layout. The plan step states the cost below, and the API emits the transaction only while no later refusal is already known from the state it reads. Alternative: leave the builder as it is and refuse cross-device cosigning for any multisig close with a conversion or a round before normalization. Rejected, for these reasons:- It would exclude most multisig closes: any account with a DeFi position, a token balance, a conversion or a claimable balance.
- With today’s layout every round before normalization needs its own handoff, each in its own 300-second window. With normalization first, a close needs exactly one handoff.
- The normalization transaction holds only
set_optionsoperations from the account: signer removals and one threshold reset. The station can check it completely and mechanically, with no conversion floor, no contract call and no quote. - The step it adds to the trust model already exists. Every batched multisig close today has a
normalization transaction without a merge, which must carry the master key and reset the thresholds
(INV-43,
assertMasterSignsSignerRemovalinapps/web/lib/stellar/signing-guards.ts). Moving it first changes the order, not what cosigners agree to.
4. Initiator journey (hub)
- The initiator reviews and confirms the plan as today. The review screen says which keys must sign, that the master key then completes the close alone, and that the other keys can sign the normalization on another device (Section 12).
- The normalization transaction pauses for more weight. The paused panel, alongside today’s “connect
another signer”, offers Sign on another device. It shows:
- the signers still able to add weight, from the live round, as
ExecutionWizardalready lists them; - the transaction hash fingerprint from the pre-sign panel
(
apps/web/components/execution/PreSignPanel.tsx), to be read to the cosigner; - the time left before the transaction expires, counted down from its
maxTime.
- the signers still able to add weight, from the live round, as
- The initiator saves the request as a file or copies it as text and sends it through any channel. The export never contains the fingerprint: it travels separately, by voice or another channel.
- The screen gives the cosigner’s instructions with the exact origin the hub is served from, written out
in full: “Open
<origin>/cosignyourself, in a browser, by typing it. Do not open a link you were sent. Type this account address, then import the request. Before you sign, type the 16 characters of the transaction hash I read to you. This request expires at<time>.” - The initiator imports each response as a file or as pasted text. The panel updates the collected weight. When the weight is met, the hub re-reads the account’s signers and thresholds and continues: preparation, submission, reconciliation.
- When a request expires before the weight is met, the panel offers Rebuild and re-export: a new build of the same step, a new request, and a new fingerprint.
5. Cosigner journey (station)
The cosigner opens LumenWipe and goes to the cosign page by typing the address. No link format exists (see decision 1).- Choose the network and type or pick the account. The station reads the account live right away, before anything is imported, because that read is the slowest step.
- Import the request, as a file or pasted text.
- Read the plain-language summary decoded from the transaction: which signers are removed, the new
thresholds, the fee. For a transaction that removes signers or resets thresholds with no merge, the
station says before signing: “Signing this gives the master key,
<master key>, sole control of this account. After it, the master key holder alone decides where the funds go.” - Type the 16 characters of the hash fingerprint the initiator reads out. The station compares them with the hash it computed itself.
- Connect one signer, held as the one active signer (
useActiveSigner). Wallets come first. A secret key sits behind a warning that the station is a page on a shared origin and that a wallet keeps the key out of the page. - Sign, then save or copy the response and send it back. The page then forgets the transaction and the signer.
6. The artifact
directionisrequestorresponse.networkispublicortestnet.accountmust equal the account the cosigner typed or picked before importing. No other field is accepted, and an unknown field, version or value refuses the artifact.- It carries no hash, no fingerprint, no plan, no expectations, no signer list and no URL. The receiver computes or reads each of those itself, so nothing in the artifact can stand in for a check or point a cosigner anywhere.
- A request carries the envelope with no signatures. A response carries the same transaction with only the signatures that station added.
- The transport is a downloaded
.jsonfile or the same text copied and pasted. Both go through one parser, which refuses an artifact above a fixed size cap before parsing it. The implementation sets the cap above the network’s current per-transaction size limit, which is a live network setting.
7. Checks on each device
7.1 Station, on importing a request
The station’s account read sends the API the network and the account address, through the same endpoint
the hub uses (
GET /v1/{network}/account/{address}). Nothing else leaves the device: the envelope, the
artifact and the cosigner’s inputs are never sent anywhere. The station makes no quote or build request.
7.2 What the station accepts and verifies against
In v1 the station accepts a transaction only when every operation is aset_options sourced from the
account that removes a signer other than the master key (weight 0) or resets the thresholds, and the
transaction resets the thresholds so the master key alone meets them. It refuses a merge, a payment, a
conversion, a trustline change, a claim and any contract call. verify() runs with the signers and
thresholds from the station’s live read, and with destination, transfer, conversion and exit expectations
that are empty, so it refuses anything else as well.
Not every expectation can come from the station’s own inputs, and none may come from the transaction it is
checking. Comparing a transaction with expectations decoded from that same transaction checks nothing. So
when a later reviewed change admits a merge or payments, the station checks them mechanically, never by a
confirmation alone:
7.3 Hub, on importing a response
The minimal set matters because a valid signature that the network does not count fails the whole
transaction with
txBAD_AUTH_EXTRA, and the order in which the network counts signatures is not something
the hub controls. Example: signers A (weight 1), B (weight 1) and C (weight 2), high threshold 2.
- The hub holds A. A response brings B. A and B together meet 2 and neither can be removed: attach both.
- The hub holds A. A response brings C. C alone meets 2, so A’s signature is not needed. Attaching both
risks
txBAD_AUTH_EXTRAwhen C is counted first. The hub attaches C and prunes A. - The hub holds A. Two responses bring B and C. Both and are minimal. The hub picks the set with fewer signatures, , and prunes A and B.
8. Validity
- One artifact covers one transaction of one round. It is valid until that transaction’s
maxTime, and only while its sequence number is the account’s next one. - A rebuild on the same sequence number, after an expiry or a cancel, does not end the old transaction on
the network. Until its
maxTime, responses for it can still be combined and submitted, and whichever of the two transactions lands first uses the sequence number, so the other fails withtxBAD_SEQ. - The sequence number does not guard the signer list. An operation sourced from this account inside
another account’s transaction can change its signers or thresholds without changing its sequence number.
That is why the hub re-reads the signers and thresholds before
prepare(check 7.3h). - A confirmed pre-authorized submission, or any other transaction from the account, uses up the sequence number and ends every outstanding artifact.
- Each device judges expiry by its own clock, and the network by ledger time. A wrong clock can only make a device refuse early or the network refuse late. It cannot make an expired transaction land.
8.1 Validity window: 300 seconds in v1
Decision: keep the API’s 300-second window. A longer one would raise how long a response stays a usable authorization (Section 9), and the mediator and sponsor rule (INV-38, 330 seconds) would have to be met at preparation time anyway. The design makes 300 seconds workable instead:- The station reads the account before import, so the slowest step is outside the window.
- The station refuses with less than 90 seconds left at import, or 60 seconds at signing.
- The hub offers Rebuild and re-export on expiry.
A prepared cosigner finishes with about 95 seconds to spare. An unprepared one adds steps the table does
not have, such as opening a mobile wallet and pairing it over WalletConnect, which can take a minute or
more. That is what Rebuild and re-export is for. With two cosigners, both sign the same request in
parallel, so the time grows by the slower of the two, not by both.
Handoff count: with normalization first (Section 3.1), a multisig close needs one cross-device handoff.
With the builder as it was before that change it would have needed one for every transaction up to and
including the one that normalizes the signers. That is every exit, token, conversion and claim round,
plus the batch that removes the signers.
9. Failure, reload and abandonment
Residual risk: a response is a bearer authorization until the transaction’s
maxTime. Anyone who holds
enough of them to meet the threshold can submit the transaction: a cosigner, a party that collected the
responses of several stations signing in parallel, or anyone who intercepted responses in transit. What
bounds this is that every signature in a response is over a transaction that the signing device verified
itself, that the window is at most 300 seconds, and that the transaction stops being valid once any other
transaction from the account uses its sequence number. The hub learns the outcome from its lookup by hash
and from its next live read (INV-02, INV-41).
10. hash(x) and pre-authorized signers
- hash(x). The station accepts wallet and secret-key signers only. A preimage is entered only on the hub, where the check that it is attached only to the transaction removing its own signer stays (INV-42). A preimage never travels in an artifact: it is a bearer secret that anyone who reads it can use until its signer is removed. A response carrying a hash(x) signature is refused by check 7.3c.
- Pre-authorized transactions. These stay a hub path (
apps/web/components/execution/PreAuthTxInput.tsxandsubmitPreAuthTransaction, with its two-step review). They need no signature, so they need no artifact. The station always verifies withpreAuthorized: false. When a pre-authorized transaction is confirmed and uses up the round’s sequence number, every outstanding artifact for that round ends. - Signed-payload signers (
ed25519_signed_payload) cannot sign in this flow on either device.
11. Decisions
- Transport: file and pasted text. No link, no QR code in v1. A link that carries a transaction teaches people to open signing links received in messages, and it lands in browser history and sync. A QR code tops out at 2,953 bytes (Section 2), which a transaction with many signer removals and signatures can exceed once base64 adds a third. It would work only some of the time and would need camera access. The artifact never carries a URL.
- No SEP-7 URIs. Without
callback, the wallet signs and submits, which skips the hub and skips LumenWipe’sverify()on the cosigner’s device. Withcallback, a server would receive signed envelopes, which this design excludes. A cosigner whose wallet supports SEP-7 can still sign through the station with WalletConnect. - Validity: 300 seconds in v1, with the floors and the rebuild in Section 8.1.
- Requests are unsigned, and responses carry only the station’s signatures. The hash excludes signatures, so signatures merge on the hub, which attaches a minimal set (check 7.3f).
- No storage of a partly signed envelope across a hub reload in v1. It lives 300 seconds at most. Storing it would create a stored, partly authorized transaction and a restore path that must verify it again, for the gain of saving one signature.
- The station signs only signer normalization in v1 (Sections 3.1 and 7.2). No conversion, exit, claim, payment or merge.
- One hub, stateless stations (Section 3). The hub holds the master key.
- The cosigner types the account and the fingerprint. The account before import, so an artifact for another account is refused. The fingerprint, read out by the initiator, so a request swapped in transit is refused. The hub never puts the fingerprint in the export.
12. Review statement
The review screen and the multisig notice on the signing step say (built byapps/web/lib/stellar/cosign-requirement.ts):
This account needs signatures from at least N of its M keys, on K transactions of this close.When N equals M, it reads “all M of its keys”. When a transaction of the close removes signers without merging the account (
assertMasterSignsSignerRemoval applies), it adds:
One transaction removes the other signers without closing the account, so the master key,
<first 8>…<last 8>, must be one of these N. After it, the master key alone completes the close.
Where the keys sign follows what Sign on another device offers on that close. The signing step offers
it only on a transaction that just removes the other signers and resets the thresholds, once the master
key has signed it in this browser (cosignExport in apps/web/lib/cosign/merge.ts). The plan’s
breakdown tells the review which case applies:
- The transaction that covers
NORMALIZE_SIGNERScovers nothing else. “These N sign during this close.”, then: ‘On that transaction the master key signs here first, and the other keys can sign here or on another device, under “Sign on another device”.’ When K is above 1, it adds: “Its other transactions that need several keys are signed here, in this browser.” - The breakdown has no such transaction (the removal also merges, carries other steps, or there is none): “These N must sign here, in this browser, during this close.”, then: “Another device can sign only a transaction that just removes the other signers, and this close has none.”
- The plan gives no breakdown: “These N sign during this close.”, then: “If a transaction of this close only removes the other signers, the other keys can sign it on another device after the master key signs it here; every other transaction is signed here, in this browser.”
- The keys alone cannot reach the threshold (below): “Another device cannot add the missing weight: it signs only with keys, and this account’s keys alone do not reach it.” A response from another device carries key signatures only, and the hub attaches nothing else to the round.
- M counts the account’s
ed25519_public_keysigners with weight above 0. A signer with weight 0 cannot sign and is not counted. - N is the smallest number of those keys whose weights together reach the signing threshold of the close (at least 1), counted from the heaviest key down. That threshold is the high one, raised to the medium or low threshold of any transaction before the removal when that one is higher: Stellar allows a medium threshold above the high one, and the same N sign every transaction up to the removal. Without a breakdown the plan may hold a DeFi exit, so the medium threshold counts. When the master key is required, N counts it among the N. The statement shows only when N is 2 or more, or when the keys alone cannot reach the threshold.
- The master key is required when the plan’s transaction that covers
NORMALIZE_SIGNERSdoes not also coverMERGE. Without a breakdown, an exchange close through the relay account requires it, and a direct close says instead: “If a transaction removes the other signers before the final transaction, the master key,<first 8>…<last 8>, must sign it as well.” - K counts, among the plan’s transactions up to and including the one that covers
NORMALIZE_SIGNERS, those whose own signing weight one key cannot reach. The removal transaction needs the high threshold. Each earlier one is judged against the threshold category of what it covers, as the signing step judges it (requiredSignatureWeight): low for a claim round that only claims, high for anything that touches signers or merges, medium otherwise. The order comes only from the breakdown’sorderfield, so K stays correct when the removal moves to its own first transaction. When the plan gives no breakdown, or none coversNORMALIZE_SIGNERS, the first sentence ends “for this close” and states no count. An earlier version counted every transaction up to the removal. That count was false when the medium or low threshold is below the high one: such a transaction is signed by fewer keys than N. - hash(x) signers are not keys that sign here and are not counted. When the account lists any, the statement adds: “It also has H hash(x) signers. A preimage is entered in this browser, and only on the step that removes its own signer.”
- Pre-authorized transaction signers are not keys that sign here and are not counted. When the account lists any, it adds: “It also has P pre-authorized transaction signers. Each is used by submitting that exact transaction in this browser, not by signing.”
- Signed-payload signers are not counted. When the account lists any, it adds: “It also has S signed-payload signers, which cannot sign in LumenWipe.”
- When the ed25519 keys together cannot reach the high threshold, the first two sentences become: “This account’s keys alone cannot reach the signing weight this close needs. It also needs its hash(x) or pre-authorized transaction signers, used in this browser. Its keys must also sign here, in this browser, during this close.” When the account has no hash(x) or pre-authorized transaction signers either, the plan is blocked and no statement is shown.
13. Invariants the build would add
Proposed rows for the invariant register, added with the implementation and not before:- The station never submits a transaction.
- An artifact carries no expectations and no URL. A request carries no signatures.
- The hub uses only verified ed25519 signatures from signers of the round, attaches a minimal set, and never uses a received transaction body.
- A device signs a received transaction only after
verify()and the approved-hash check pass on that device, withpreAuthorized: falseon the station. - The station sends the API only the network and the account address.
14. Security design review
Reviewed on 2026-11-07, on the draft written against commitf369477 of main.
Verdict: approved with required changes. All the changes are made in this revision.
Decisions on the questions put to the review:
- Validity window. Keep 300 seconds for v1. The station reads the account before import, refuses below 90 seconds at import and 60 at signing, and the hub offers a rebuild on expiry (Section 8.1).
- Transfers confirmed by a person. Not acceptable. Expectations decoded from the transaction being checked are circular. Transfers, trustlines and amounts are checked mechanically (Section 7.2).
- Conversions on the station. Refused. With signer normalization as its own first transaction, the station signs only that transaction in v1 (Section 3.1).
- Checks the artifact can influence. The account, the approved hash and the fingerprint could. The account is typed before import, the approved hash is stored at verify time, and the fingerprint is typed by the cosigner and never exported.
- Residual risk. Restated: responses are bearer authorizations until
maxTime(Section 9).