State minimization in MuSig2 signing sessions

Mar 1 - Nov 25, 2026

  • Efficient management of signing flows for hardware wallets, particularly in the context of Bitcoin’s BIP 0327, is vital due to the storage limitations inherent to such devices.

The proposal introduces a system that structures signing sessions at the level of Partially Signed Bitcoin Transactions (PSBTs), allowing devices with limited persistent memory to efficiently process transactions containing many inputs. This is achieved by generating synthetic randomness for each input and key pair via a global random number called rand_root. For every transaction, rand_root is used as the basis for deriving session-specific random values (rand') for each input/key pair through SHA256 hashing, ensuring both uniqueness and resistance to collisions. This framework enables devices to create and validate public nonces and partial signatures without needing to store extensive state across sessions, overcoming a major limitation of embedded hardware.

The workflow comprises two main phases: pubnonce generation and partial signature creation. Initially, the PSBT, devoid of pubnonces, is sent to the device, which triggers the generation of rand_root and starts a new signing session. Pubnonces are generated per input/key pair, after which the session's secret, rand_root, is saved to persistent storage. When the updated PSBT containing pubnonces is returned to the device, the session is recreated in volatile memory, pubnonces are validated, and partial signatures are produced using the previously established synthetic randomness. Security is maintained by securely storing rand_root and ensuring it is never reused between sessions, thereby mitigating risks of nonce reuse, which could compromise private keys. This method also demonstrates resilience against malleability attacks, since changes to transaction data cannot predictably affect the secnonce/pubnonce outputs, thanks to the secure derivation of synthetic randomness. The ability to support multiple concurrent signing sessions through unique session identifiers further enhances the robustness and flexibility of this approach. More information and related proposals can be found in the discussions on descriptor containing musig() and wallet policy.

BitEscrow’s implementation exemplifies practical adoption of parallel MuSig2 signing sessions, employing terminology such as "root_nonce" and "session_id." Their work, available at BitEscrow/escrow-core, explores advanced features like computing branching paths from initial nonce values, enabling use cases such as running virtual machines with Discreet Log Contracts (DLCs). Despite these technical advancements, there is an acknowledgment that the real-world impact may not match the theoretical excitement promised by such innovations.

A notable debate centers on the use of CounterNonceGen for nonce creation, as described in recent BIPs. The primary concern involves the requirement for access to the secret key during nonce generation—a step that may raise security and operational challenges. Such requirements must balance cryptographic best practices against the need for functional efficiency, especially given the sensitivity of private keys and the necessity to avoid exposing them unnecessarily. This tension reflects broader trends in protocol development, highlighting the iterative nature of enhancing cryptographic processes to address emerging threats and operational constraints.

Ledger device implementations add another layer to the discourse, specifically around how nonces should be generated. One suggested approach leverages the True Random Number Generator (TRNG) within Ledger’s Secure Element for nonce creation, while another relies on CounterNonceGen with a secure atomic counter. Although the underlying mechanisms differ, both methods adhere to the same overarching strategy for managing psbt-level signing sessions. Ensuring session integrity when handling multiple PSBT signing flows simultaneously requires careful commitment to initial counter values and the expected number of signatures within each session, identified by a distinct session_id. This structured approach is essential for preventing nonce reuse and maintaining auditability of the signing process.

Generating random numbers for each (input, key) pair from a root value using the NonceGen function is recognized as a theoretically sound technique. While hash functions like SHA256 are commonly used—partly due to their presence in related cryptographic processes—it is noted that stream ciphers such as ChaCha20 could serve as more resource-efficient alternatives. Nevertheless, the widespread reliance on hash functions continues, largely because they fulfill the necessary cryptographic guarantees. The terminology surrounding these concepts is evolving, with terms like rand_root increasingly being replaced by seed, psbt_seed, or rand_seed to better reflect their roles. Handling multiple parallel signing sessions can be facilitated by assigning unique session identifiers derived from hashes of transaction-specific information, such as the transaction ID (txid) and wallet policy. However, caution is advised, as hashing txid and wallet policy together may introduce subtle risks when processing multiple PSBTs for the same transaction.

Concerns about possible vulnerabilities arise when multiple PSBTs for the same transaction are processed. If altered PSBTs do not change the NonceGen output

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback