Metadata-Version: 2.5
Name: multisig
Version: 0.1.0
Summary: Offline multisig escrow for Bitcoin, EVM, and Monero
Author: multisig contributors
License: MIT License
        
        Copyright (c) 2026 multisig_escrow contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: bitcoin,escrow,ethereum,monero,multisig
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: all
Requires-Dist: coincurve<22,>=21; extra == 'all'
Requires-Dist: cryptography<47,>=43; extra == 'all'
Requires-Dist: embit<0.9,>=0.8; extra == 'all'
Requires-Dist: eth-abi<7,>=6; extra == 'all'
Requires-Dist: eth-hash[pycryptodome]<0.9,>=0.8; extra == 'all'
Requires-Dist: eth-keys<0.9,>=0.8; extra == 'all'
Requires-Dist: eth-typing<7,>=6; extra == 'all'
Requires-Dist: eth-utils<7,>=6; extra == 'all'
Requires-Dist: hexbytes<3,>=1; extra == 'all'
Requires-Dist: pycryptodome<4,>=3.20; extra == 'all'
Provides-Extra: bitcoin
Requires-Dist: coincurve<22,>=21; extra == 'bitcoin'
Requires-Dist: embit<0.9,>=0.8; extra == 'bitcoin'
Provides-Extra: evm
Requires-Dist: eth-abi<7,>=6; extra == 'evm'
Requires-Dist: eth-hash[pycryptodome]<0.9,>=0.8; extra == 'evm'
Requires-Dist: eth-keys<0.9,>=0.8; extra == 'evm'
Requires-Dist: eth-typing<7,>=6; extra == 'evm'
Requires-Dist: eth-utils<7,>=6; extra == 'evm'
Requires-Dist: hexbytes<3,>=1; extra == 'evm'
Provides-Extra: monero
Requires-Dist: cryptography<47,>=43; extra == 'monero'
Requires-Dist: pycryptodome<4,>=3.20; extra == 'monero'
Provides-Extra: test
Requires-Dist: coverage<8,>=7; extra == 'test'
Requires-Dist: hypothesis<7,>=6; extra == 'test'
Requires-Dist: pytest<10,>=8; extra == 'test'
Description-Content-Type: text/markdown

# multisig

Offline multisig escrow for Bitcoin, EVM Safe accounts, and Monero.

`multisig` builds and verifies funding targets, settlement plans, PSBTs, Safe
calldata, Monero settlement plans, and signed approval tokens without connecting
to a node, RPC endpoint, or wallet. It never accepts private keys, private view
keys, wallet files, seed phrases, or multisig secret shares.

**Distribution:** `multisig`  
**Python import:** `multisig_escrow`  
**Version:** 0.1.0

## Install

```bash
pip install multisig
pip install "multisig[bitcoin]"
pip install "multisig[evm]"
pip install "multisig[monero]"
```

Python 3.11 or newer. The core package has no runtime dependencies. Chain
support is optional and imported lazily.

## Supported coins and chains

Only these coins and chains are supported for now.

**Bitcoin:** BTC on P2WSH sortedmulti, optional P2SH P2WSH, optional CSV refund.

**EVM:** ETH and allowlisted ERC20 on supported EVM chains with Safe v1.3.0 or v1.4.1.

**Monero:** XMR with experimental CLSAG 2 of 3 and optional pre signed `unlock_time` refund.

Additional coins and chains will be added in future releases.

## Quick start

```python
from multisig_escrow import BitcoinEscrow, MemoryStore

store = MemoryStore()
escrow = BitcoinEscrow.create(terms, store=store)
target = escrow.funding_target()
escrow.fund(evidence, context)
proposal = escrow.propose_release(signer_id, params)
escrow.approve(signed_psbt)
settlement = escrow.finalize()
```

EVM flows use `EvmEscrow` with `SafeFundingEvidence`, `EvmReleaseParams`, or
`EvmRefundParams`. Monero flows use `MoneroEscrow` with
`MoneroFundingEvidence`, `MoneroReleaseParams`, or `MoneroRefundParams`. All
three facades share the same FSM, optimistic store contract, approval token
rules, and broadcast and confirmation checks.

For Monero, funding requires a `MoneroFundingVerifier`, finalization requires a
`MoneroSettlementVerifier`, and CLSAG verification uses a pinned external
Monero Oxide verifier. Missing verifiers fail closed.

## Safe reload

A record has a `terms_hash` consistency value, not an authenticated trust
anchor. Keep the trusted hash outside the mutable store and verify it on every
load:

```python
from multisig_escrow import BitcoinEscrow

trusted_terms_hash = load_trusted_hash_from_signed_manifest(escrow_id)
escrow = BitcoinEscrow.load(
    escrow_id,
    store=store,
    clock=clock,
    trusted_terms_hash=trusted_terms_hash,
)
```

The same pattern applies to `EvmEscrow` and `MoneroEscrow`. Loading without a
trusted anchor is possible for migration and testing, but is unsafe for
production operation.

## Operator checklist

Every item is mandatory before funding.

**Terms anchor:** Persist the trusted terms hash or signed terms manifest outside the store.

**Device display:** Verify the destination, amount, fee, network, asset, change, and operation on the signing device.

**Payout check:** Confirm the payout destination through an independent channel.

**Confirmation policy:** Record a chain specific confirmation depth and freshness window.

**Concurrency:** Use one writer per escrow, or a per escrow lock or retry loop.

**Monero verifiers:** Pin the funding verifier and settlement verifier, and pin the Monero Oxide binary by hash.

**R24 acceptance:** Record explicit acceptance of R24 before using Monero.

**Stop rule:** Stop if any item cannot be checked.

## Contributions

Contributions are very much appreciated. If you find an issue, a vulnerability, or a bug, whether you used AI or not, please report it and submit a fix if you can. This project is maintained by one developer.

For security reports, read [SECURITY.md](SECURITY.md) before opening a public issue.

## Security status

**R24 remains Critical.** Monero CLSAG, RingCT, multisig, parser behavior,
wallet interoperability, and the native verifier boundary remain high risk.
Monero is experimental and must remain testnet and value capped. Use with real
funds only after completing the operator checklist and explicitly accepting R24.

Read [SECURITY.md](SECURITY.md) before deploying.

## License

MIT. See [LICENSE](LICENSE).
