multisig 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- multisig-0.1.0/LICENSE +21 -0
- multisig-0.1.0/PKG-INFO +188 -0
- multisig-0.1.0/README.md +121 -0
- multisig-0.1.0/SECURITY.md +111 -0
- multisig-0.1.0/pyproject.toml +155 -0
- multisig-0.1.0/src/multisig_escrow/__init__.py +152 -0
- multisig-0.1.0/src/multisig_escrow/authenticity.py +45 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/__init__.py +124 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/addresses.py +103 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/assets.py +29 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/descriptor.py +211 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/fees.py +282 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/finalize.py +271 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/funding.py +153 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/keys.py +209 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/params.py +66 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/policy.py +158 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/psbt.py +241 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/timelock.py +166 -0
- multisig-0.1.0/src/multisig_escrow/bitcoin/verify.py +709 -0
- multisig-0.1.0/src/multisig_escrow/core/__init__.py +134 -0
- multisig-0.1.0/src/multisig_escrow/core/amounts.py +24 -0
- multisig-0.1.0/src/multisig_escrow/core/capabilities.py +273 -0
- multisig-0.1.0/src/multisig_escrow/core/codec.py +122 -0
- multisig-0.1.0/src/multisig_escrow/core/errors.py +104 -0
- multisig-0.1.0/src/multisig_escrow/core/ids.py +56 -0
- multisig-0.1.0/src/multisig_escrow/core/protocol.py +46 -0
- multisig-0.1.0/src/multisig_escrow/core/roles.py +196 -0
- multisig-0.1.0/src/multisig_escrow/core/terms.py +437 -0
- multisig-0.1.0/src/multisig_escrow/core/time.py +73 -0
- multisig-0.1.0/src/multisig_escrow/core/validation.py +127 -0
- multisig-0.1.0/src/multisig_escrow/evm/__init__.py +97 -0
- multisig-0.1.0/src/multisig_escrow/evm/addresses.py +72 -0
- multisig-0.1.0/src/multisig_escrow/evm/assets.py +76 -0
- multisig-0.1.0/src/multisig_escrow/evm/calldata.py +142 -0
- multisig-0.1.0/src/multisig_escrow/evm/deployment.py +201 -0
- multisig-0.1.0/src/multisig_escrow/evm/eip712.py +138 -0
- multisig-0.1.0/src/multisig_escrow/evm/funding.py +89 -0
- multisig-0.1.0/src/multisig_escrow/evm/params.py +38 -0
- multisig-0.1.0/src/multisig_escrow/evm/payouts.py +66 -0
- multisig-0.1.0/src/multisig_escrow/evm/plan.py +63 -0
- multisig-0.1.0/src/multisig_escrow/evm/safe.py +236 -0
- multisig-0.1.0/src/multisig_escrow/evm/signatures.py +181 -0
- multisig-0.1.0/src/multisig_escrow/evm/verify.py +732 -0
- multisig-0.1.0/src/multisig_escrow/facade.py +2532 -0
- multisig-0.1.0/src/multisig_escrow/fsm/__init__.py +95 -0
- multisig-0.1.0/src/multisig_escrow/fsm/events.py +95 -0
- multisig-0.1.0/src/multisig_escrow/fsm/invariants.py +287 -0
- multisig-0.1.0/src/multisig_escrow/fsm/machine.py +547 -0
- multisig-0.1.0/src/multisig_escrow/fsm/plan.py +24 -0
- multisig-0.1.0/src/multisig_escrow/fsm/record.py +271 -0
- multisig-0.1.0/src/multisig_escrow/fsm/serialize.py +453 -0
- multisig-0.1.0/src/multisig_escrow/fsm/states.py +86 -0
- multisig-0.1.0/src/multisig_escrow/fsm/tokens.py +466 -0
- multisig-0.1.0/src/multisig_escrow/monero/__init__.py +86 -0
- multisig-0.1.0/src/multisig_escrow/monero/adapter.py +741 -0
- multisig-0.1.0/src/multisig_escrow/monero/addresses.py +144 -0
- multisig-0.1.0/src/multisig_escrow/monero/approval.py +149 -0
- multisig-0.1.0/src/multisig_escrow/monero/crypto.py +234 -0
- multisig-0.1.0/src/multisig_escrow/monero/facade.py +610 -0
- multisig-0.1.0/src/multisig_escrow/monero/funding.py +217 -0
- multisig-0.1.0/src/multisig_escrow/monero/key_images.py +49 -0
- multisig-0.1.0/src/multisig_escrow/monero/keys.py +53 -0
- multisig-0.1.0/src/multisig_escrow/monero/manifest.py +103 -0
- multisig-0.1.0/src/multisig_escrow/monero/multisig.py +55 -0
- multisig-0.1.0/src/multisig_escrow/monero/params.py +76 -0
- multisig-0.1.0/src/multisig_escrow/monero/refund.py +119 -0
- multisig-0.1.0/src/multisig_escrow/monero/settlement.py +299 -0
- multisig-0.1.0/src/multisig_escrow/monero/terms.py +216 -0
- multisig-0.1.0/src/multisig_escrow/py.typed +0 -0
- multisig-0.1.0/src/multisig_escrow/store.py +115 -0
multisig-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 multisig_escrow contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
multisig-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: multisig
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Offline multisig escrow for Bitcoin, EVM, and Monero
|
|
5
|
+
Author: multisig contributors
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 multisig_escrow contributors
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Keywords: bitcoin,escrow,ethereum,monero,multisig
|
|
29
|
+
Classifier: Development Status :: 3 - Alpha
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
36
|
+
Classifier: Typing :: Typed
|
|
37
|
+
Requires-Python: >=3.11
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: coincurve<22,>=21; extra == 'all'
|
|
40
|
+
Requires-Dist: cryptography<47,>=43; extra == 'all'
|
|
41
|
+
Requires-Dist: embit<0.9,>=0.8; extra == 'all'
|
|
42
|
+
Requires-Dist: eth-abi<7,>=6; extra == 'all'
|
|
43
|
+
Requires-Dist: eth-hash[pycryptodome]<0.9,>=0.8; extra == 'all'
|
|
44
|
+
Requires-Dist: eth-keys<0.9,>=0.8; extra == 'all'
|
|
45
|
+
Requires-Dist: eth-typing<7,>=6; extra == 'all'
|
|
46
|
+
Requires-Dist: eth-utils<7,>=6; extra == 'all'
|
|
47
|
+
Requires-Dist: hexbytes<3,>=1; extra == 'all'
|
|
48
|
+
Requires-Dist: pycryptodome<4,>=3.20; extra == 'all'
|
|
49
|
+
Provides-Extra: bitcoin
|
|
50
|
+
Requires-Dist: coincurve<22,>=21; extra == 'bitcoin'
|
|
51
|
+
Requires-Dist: embit<0.9,>=0.8; extra == 'bitcoin'
|
|
52
|
+
Provides-Extra: evm
|
|
53
|
+
Requires-Dist: eth-abi<7,>=6; extra == 'evm'
|
|
54
|
+
Requires-Dist: eth-hash[pycryptodome]<0.9,>=0.8; extra == 'evm'
|
|
55
|
+
Requires-Dist: eth-keys<0.9,>=0.8; extra == 'evm'
|
|
56
|
+
Requires-Dist: eth-typing<7,>=6; extra == 'evm'
|
|
57
|
+
Requires-Dist: eth-utils<7,>=6; extra == 'evm'
|
|
58
|
+
Requires-Dist: hexbytes<3,>=1; extra == 'evm'
|
|
59
|
+
Provides-Extra: monero
|
|
60
|
+
Requires-Dist: cryptography<47,>=43; extra == 'monero'
|
|
61
|
+
Requires-Dist: pycryptodome<4,>=3.20; extra == 'monero'
|
|
62
|
+
Provides-Extra: test
|
|
63
|
+
Requires-Dist: coverage<8,>=7; extra == 'test'
|
|
64
|
+
Requires-Dist: hypothesis<7,>=6; extra == 'test'
|
|
65
|
+
Requires-Dist: pytest<10,>=8; extra == 'test'
|
|
66
|
+
Description-Content-Type: text/markdown
|
|
67
|
+
|
|
68
|
+
# multisig
|
|
69
|
+
|
|
70
|
+
Offline multisig escrow for Bitcoin, EVM Safe accounts, and Monero.
|
|
71
|
+
|
|
72
|
+
`multisig` builds and verifies funding targets, settlement plans, PSBTs, Safe
|
|
73
|
+
calldata, Monero settlement plans, and signed approval tokens without connecting
|
|
74
|
+
to a node, RPC endpoint, or wallet. It never accepts private keys, private view
|
|
75
|
+
keys, wallet files, seed phrases, or multisig secret shares.
|
|
76
|
+
|
|
77
|
+
**Distribution:** `multisig`
|
|
78
|
+
**Python import:** `multisig_escrow`
|
|
79
|
+
**Version:** 0.1.0
|
|
80
|
+
|
|
81
|
+
## Install
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install multisig
|
|
85
|
+
pip install "multisig[bitcoin]"
|
|
86
|
+
pip install "multisig[evm]"
|
|
87
|
+
pip install "multisig[monero]"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Python 3.11 or newer. The core package has no runtime dependencies. Chain
|
|
91
|
+
support is optional and imported lazily.
|
|
92
|
+
|
|
93
|
+
## Supported coins and chains
|
|
94
|
+
|
|
95
|
+
Only these coins and chains are supported for now.
|
|
96
|
+
|
|
97
|
+
**Bitcoin:** BTC on P2WSH sortedmulti, optional P2SH P2WSH, optional CSV refund.
|
|
98
|
+
|
|
99
|
+
**EVM:** ETH and allowlisted ERC20 on supported EVM chains with Safe v1.3.0 or v1.4.1.
|
|
100
|
+
|
|
101
|
+
**Monero:** XMR with experimental CLSAG 2 of 3 and optional pre signed `unlock_time` refund.
|
|
102
|
+
|
|
103
|
+
Additional coins and chains will be added in future releases.
|
|
104
|
+
|
|
105
|
+
## Quick start
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from multisig_escrow import BitcoinEscrow, MemoryStore
|
|
109
|
+
|
|
110
|
+
store = MemoryStore()
|
|
111
|
+
escrow = BitcoinEscrow.create(terms, store=store)
|
|
112
|
+
target = escrow.funding_target()
|
|
113
|
+
escrow.fund(evidence, context)
|
|
114
|
+
proposal = escrow.propose_release(signer_id, params)
|
|
115
|
+
escrow.approve(signed_psbt)
|
|
116
|
+
settlement = escrow.finalize()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
EVM flows use `EvmEscrow` with `SafeFundingEvidence`, `EvmReleaseParams`, or
|
|
120
|
+
`EvmRefundParams`. Monero flows use `MoneroEscrow` with
|
|
121
|
+
`MoneroFundingEvidence`, `MoneroReleaseParams`, or `MoneroRefundParams`. All
|
|
122
|
+
three facades share the same FSM, optimistic store contract, approval token
|
|
123
|
+
rules, and broadcast and confirmation checks.
|
|
124
|
+
|
|
125
|
+
For Monero, funding requires a `MoneroFundingVerifier`, finalization requires a
|
|
126
|
+
`MoneroSettlementVerifier`, and CLSAG verification uses a pinned external
|
|
127
|
+
Monero Oxide verifier. Missing verifiers fail closed.
|
|
128
|
+
|
|
129
|
+
## Safe reload
|
|
130
|
+
|
|
131
|
+
A record has a `terms_hash` consistency value, not an authenticated trust
|
|
132
|
+
anchor. Keep the trusted hash outside the mutable store and verify it on every
|
|
133
|
+
load:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from multisig_escrow import BitcoinEscrow
|
|
137
|
+
|
|
138
|
+
trusted_terms_hash = load_trusted_hash_from_signed_manifest(escrow_id)
|
|
139
|
+
escrow = BitcoinEscrow.load(
|
|
140
|
+
escrow_id,
|
|
141
|
+
store=store,
|
|
142
|
+
clock=clock,
|
|
143
|
+
trusted_terms_hash=trusted_terms_hash,
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The same pattern applies to `EvmEscrow` and `MoneroEscrow`. Loading without a
|
|
148
|
+
trusted anchor is possible for migration and testing, but is unsafe for
|
|
149
|
+
production operation.
|
|
150
|
+
|
|
151
|
+
## Operator checklist
|
|
152
|
+
|
|
153
|
+
Every item is mandatory before funding.
|
|
154
|
+
|
|
155
|
+
**Terms anchor:** Persist the trusted terms hash or signed terms manifest outside the store.
|
|
156
|
+
|
|
157
|
+
**Device display:** Verify the destination, amount, fee, network, asset, change, and operation on the signing device.
|
|
158
|
+
|
|
159
|
+
**Payout check:** Confirm the payout destination through an independent channel.
|
|
160
|
+
|
|
161
|
+
**Confirmation policy:** Record a chain specific confirmation depth and freshness window.
|
|
162
|
+
|
|
163
|
+
**Concurrency:** Use one writer per escrow, or a per escrow lock or retry loop.
|
|
164
|
+
|
|
165
|
+
**Monero verifiers:** Pin the funding verifier and settlement verifier, and pin the Monero Oxide binary by hash.
|
|
166
|
+
|
|
167
|
+
**R24 acceptance:** Record explicit acceptance of R24 before using Monero.
|
|
168
|
+
|
|
169
|
+
**Stop rule:** Stop if any item cannot be checked.
|
|
170
|
+
|
|
171
|
+
## Contributions
|
|
172
|
+
|
|
173
|
+
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.
|
|
174
|
+
|
|
175
|
+
For security reports, read [SECURITY.md](SECURITY.md) before opening a public issue.
|
|
176
|
+
|
|
177
|
+
## Security status
|
|
178
|
+
|
|
179
|
+
**R24 remains Critical.** Monero CLSAG, RingCT, multisig, parser behavior,
|
|
180
|
+
wallet interoperability, and the native verifier boundary remain high risk.
|
|
181
|
+
Monero is experimental and must remain testnet and value capped. Use with real
|
|
182
|
+
funds only after completing the operator checklist and explicitly accepting R24.
|
|
183
|
+
|
|
184
|
+
Read [SECURITY.md](SECURITY.md) before deploying.
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT. See [LICENSE](LICENSE).
|
multisig-0.1.0/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# multisig
|
|
2
|
+
|
|
3
|
+
Offline multisig escrow for Bitcoin, EVM Safe accounts, and Monero.
|
|
4
|
+
|
|
5
|
+
`multisig` builds and verifies funding targets, settlement plans, PSBTs, Safe
|
|
6
|
+
calldata, Monero settlement plans, and signed approval tokens without connecting
|
|
7
|
+
to a node, RPC endpoint, or wallet. It never accepts private keys, private view
|
|
8
|
+
keys, wallet files, seed phrases, or multisig secret shares.
|
|
9
|
+
|
|
10
|
+
**Distribution:** `multisig`
|
|
11
|
+
**Python import:** `multisig_escrow`
|
|
12
|
+
**Version:** 0.1.0
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install multisig
|
|
18
|
+
pip install "multisig[bitcoin]"
|
|
19
|
+
pip install "multisig[evm]"
|
|
20
|
+
pip install "multisig[monero]"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Python 3.11 or newer. The core package has no runtime dependencies. Chain
|
|
24
|
+
support is optional and imported lazily.
|
|
25
|
+
|
|
26
|
+
## Supported coins and chains
|
|
27
|
+
|
|
28
|
+
Only these coins and chains are supported for now.
|
|
29
|
+
|
|
30
|
+
**Bitcoin:** BTC on P2WSH sortedmulti, optional P2SH P2WSH, optional CSV refund.
|
|
31
|
+
|
|
32
|
+
**EVM:** ETH and allowlisted ERC20 on supported EVM chains with Safe v1.3.0 or v1.4.1.
|
|
33
|
+
|
|
34
|
+
**Monero:** XMR with experimental CLSAG 2 of 3 and optional pre signed `unlock_time` refund.
|
|
35
|
+
|
|
36
|
+
Additional coins and chains will be added in future releases.
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from multisig_escrow import BitcoinEscrow, MemoryStore
|
|
42
|
+
|
|
43
|
+
store = MemoryStore()
|
|
44
|
+
escrow = BitcoinEscrow.create(terms, store=store)
|
|
45
|
+
target = escrow.funding_target()
|
|
46
|
+
escrow.fund(evidence, context)
|
|
47
|
+
proposal = escrow.propose_release(signer_id, params)
|
|
48
|
+
escrow.approve(signed_psbt)
|
|
49
|
+
settlement = escrow.finalize()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
EVM flows use `EvmEscrow` with `SafeFundingEvidence`, `EvmReleaseParams`, or
|
|
53
|
+
`EvmRefundParams`. Monero flows use `MoneroEscrow` with
|
|
54
|
+
`MoneroFundingEvidence`, `MoneroReleaseParams`, or `MoneroRefundParams`. All
|
|
55
|
+
three facades share the same FSM, optimistic store contract, approval token
|
|
56
|
+
rules, and broadcast and confirmation checks.
|
|
57
|
+
|
|
58
|
+
For Monero, funding requires a `MoneroFundingVerifier`, finalization requires a
|
|
59
|
+
`MoneroSettlementVerifier`, and CLSAG verification uses a pinned external
|
|
60
|
+
Monero Oxide verifier. Missing verifiers fail closed.
|
|
61
|
+
|
|
62
|
+
## Safe reload
|
|
63
|
+
|
|
64
|
+
A record has a `terms_hash` consistency value, not an authenticated trust
|
|
65
|
+
anchor. Keep the trusted hash outside the mutable store and verify it on every
|
|
66
|
+
load:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from multisig_escrow import BitcoinEscrow
|
|
70
|
+
|
|
71
|
+
trusted_terms_hash = load_trusted_hash_from_signed_manifest(escrow_id)
|
|
72
|
+
escrow = BitcoinEscrow.load(
|
|
73
|
+
escrow_id,
|
|
74
|
+
store=store,
|
|
75
|
+
clock=clock,
|
|
76
|
+
trusted_terms_hash=trusted_terms_hash,
|
|
77
|
+
)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The same pattern applies to `EvmEscrow` and `MoneroEscrow`. Loading without a
|
|
81
|
+
trusted anchor is possible for migration and testing, but is unsafe for
|
|
82
|
+
production operation.
|
|
83
|
+
|
|
84
|
+
## Operator checklist
|
|
85
|
+
|
|
86
|
+
Every item is mandatory before funding.
|
|
87
|
+
|
|
88
|
+
**Terms anchor:** Persist the trusted terms hash or signed terms manifest outside the store.
|
|
89
|
+
|
|
90
|
+
**Device display:** Verify the destination, amount, fee, network, asset, change, and operation on the signing device.
|
|
91
|
+
|
|
92
|
+
**Payout check:** Confirm the payout destination through an independent channel.
|
|
93
|
+
|
|
94
|
+
**Confirmation policy:** Record a chain specific confirmation depth and freshness window.
|
|
95
|
+
|
|
96
|
+
**Concurrency:** Use one writer per escrow, or a per escrow lock or retry loop.
|
|
97
|
+
|
|
98
|
+
**Monero verifiers:** Pin the funding verifier and settlement verifier, and pin the Monero Oxide binary by hash.
|
|
99
|
+
|
|
100
|
+
**R24 acceptance:** Record explicit acceptance of R24 before using Monero.
|
|
101
|
+
|
|
102
|
+
**Stop rule:** Stop if any item cannot be checked.
|
|
103
|
+
|
|
104
|
+
## Contributions
|
|
105
|
+
|
|
106
|
+
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.
|
|
107
|
+
|
|
108
|
+
For security reports, read [SECURITY.md](SECURITY.md) before opening a public issue.
|
|
109
|
+
|
|
110
|
+
## Security status
|
|
111
|
+
|
|
112
|
+
**R24 remains Critical.** Monero CLSAG, RingCT, multisig, parser behavior,
|
|
113
|
+
wallet interoperability, and the native verifier boundary remain high risk.
|
|
114
|
+
Monero is experimental and must remain testnet and value capped. Use with real
|
|
115
|
+
funds only after completing the operator checklist and explicitly accepting R24.
|
|
116
|
+
|
|
117
|
+
Read [SECURITY.md](SECURITY.md) before deploying.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
**Version:** 0.1.0
|
|
6
|
+
**R24:** Critical
|
|
7
|
+
|
|
8
|
+
**R24 remains Critical.** Monero CLSAG, RingCT, multisig, parser behavior,
|
|
9
|
+
wallet interoperability, and the native verifier boundary remain high risk.
|
|
10
|
+
Monero is experimental and must remain testnet and value capped. Use this
|
|
11
|
+
library with real funds only after completing the operator checklist and
|
|
12
|
+
explicitly accepting R24.
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
Only these coins and chains are supported for now.
|
|
17
|
+
|
|
18
|
+
**Bitcoin:** BTC with P2WSH, descriptors, and PSBT.
|
|
19
|
+
|
|
20
|
+
**EVM:** ETH and allowlisted ERC20 on supported EVM chains with Safe v1.3.0 or v1.4.1.
|
|
21
|
+
|
|
22
|
+
**Monero:** XMR with experimental CLSAG 2 of 3.
|
|
23
|
+
|
|
24
|
+
Additional coins and chains will be added in future releases. Other chains are out of scope.
|
|
25
|
+
|
|
26
|
+
## Operator checklist
|
|
27
|
+
|
|
28
|
+
Every item is mandatory. If any item cannot be checked and recorded, do not
|
|
29
|
+
create, fund, approve, or broadcast an escrow.
|
|
30
|
+
|
|
31
|
+
**Terms anchor:** Persist a trusted terms hash or signed terms manifest outside the mutable store and verify it on every load.
|
|
32
|
+
|
|
33
|
+
**Device display:** The signer reads destination, amount, fee, network, asset, change, and operation on the signing device.
|
|
34
|
+
|
|
35
|
+
**Payout check:** Compare the payout destination against an independent channel, not chat, email, a screenshot, or coordinator UI.
|
|
36
|
+
|
|
37
|
+
**Confirmation policy:** Record a chain specific depth and freshness window appropriate to the value at risk and reject stale or future tips.
|
|
38
|
+
|
|
39
|
+
**Concurrency:** Use one writer per escrow, a per escrow lock or queue, or a retry loop after reload.
|
|
40
|
+
|
|
41
|
+
**Monero verifiers:** Pin the funding verifier and settlement verifier, build the Monero Oxide 0.1.0 binary from pinned source, pin it by hash, and verify its digest on every deployment.
|
|
42
|
+
|
|
43
|
+
**R24 acceptance:** For Monero, record explicit signed acceptance of R24, the value cap, and the testnet or stagenet rollout.
|
|
44
|
+
|
|
45
|
+
**Store integrity:** Do not treat `MemoryStore` as tamper evident. Use an authenticated store or append only audit log.
|
|
46
|
+
|
|
47
|
+
## Terms authenticity
|
|
48
|
+
|
|
49
|
+
A record has a `terms_hash` consistency value, not an authenticated trust
|
|
50
|
+
anchor. The store is not trusted to define the terms.
|
|
51
|
+
|
|
52
|
+
Persist the expected terms hash, or a signed terms manifest, outside the mutable
|
|
53
|
+
store and verify it on every load with the facade parameter or
|
|
54
|
+
`multisig_escrow.require_trusted_terms`.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
escrow = BitcoinEscrow.load(
|
|
58
|
+
escrow_id,
|
|
59
|
+
store=store,
|
|
60
|
+
clock=clock,
|
|
61
|
+
trusted_terms_hash=trusted_terms_hash,
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The same pattern applies to `EvmEscrow` and `MoneroEscrow`. Loading without an
|
|
66
|
+
anchor is possible for migration and testing, but is unsafe for production.
|
|
67
|
+
|
|
68
|
+
## Concurrency
|
|
69
|
+
|
|
70
|
+
The store uses optimistic revision checks. Concurrent writers can receive
|
|
71
|
+
`StoreConflictError` and the library fails closed rather than merging state.
|
|
72
|
+
|
|
73
|
+
Use one writer per escrow, wrap each escrow in a per escrow lock or queue, or
|
|
74
|
+
retry the losing operation after reloading the latest record. Do not share
|
|
75
|
+
mutable facade instances across threads without external serialization.
|
|
76
|
+
|
|
77
|
+
## Monero verifiers and native binary
|
|
78
|
+
|
|
79
|
+
Monero requires trusted external components.
|
|
80
|
+
|
|
81
|
+
**Funding verifier:** `MoneroFundingVerifier` verifies funding evidence.
|
|
82
|
+
|
|
83
|
+
**Settlement verifier:** `MoneroSettlementVerifier` attests the payout address and amount.
|
|
84
|
+
|
|
85
|
+
**Native verifier:** The Monero Oxide 0.1.0 verifier is external and is not bundled in the wheel.
|
|
86
|
+
|
|
87
|
+
Build the native verifier from pinned source, verify its hash, ship it through
|
|
88
|
+
a signed release channel, and select it with `MONERO_OXIDE_VERIFY_BIN` or
|
|
89
|
+
`MoneroOxideVerifier`. Missing, failing, or malformed verifier output fails
|
|
90
|
+
closed.
|
|
91
|
+
|
|
92
|
+
The native verifier binds raw output keys and commitments, but RingCT hides
|
|
93
|
+
address and amount. That disclosure remains the responsibility of the pinned
|
|
94
|
+
`MoneroSettlementVerifier`. No private view key is accepted by the library.
|
|
95
|
+
|
|
96
|
+
## Evidence
|
|
97
|
+
|
|
98
|
+
All chain evidence is caller supplied. The library verifies structure,
|
|
99
|
+
signatures, payload binding, and declared freshness, but it cannot query a chain
|
|
100
|
+
or prove inclusion. Use a trusted node, independent verifier, or chain proof for
|
|
101
|
+
funding, maturity, broadcast, and confirmation evidence.
|
|
102
|
+
|
|
103
|
+
## Contributions
|
|
104
|
+
|
|
105
|
+
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.
|
|
106
|
+
|
|
107
|
+
## Reporting
|
|
108
|
+
|
|
109
|
+
Report suspected vulnerabilities privately to the maintainers. Do not open a
|
|
110
|
+
public issue for a report that may affect funds. Include the affected version,
|
|
111
|
+
chain, reproduction steps or vector, impact, and any proposed mitigation.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "multisig"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Offline multisig escrow for Bitcoin, EVM, and Monero"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [{ name = "multisig contributors" }]
|
|
13
|
+
keywords = ["escrow", "multisig", "bitcoin", "ethereum", "monero"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
dependencies = []
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
bitcoin = [
|
|
28
|
+
"embit>=0.8,<0.9",
|
|
29
|
+
"coincurve>=21,<22",
|
|
30
|
+
]
|
|
31
|
+
evm = [
|
|
32
|
+
"eth-abi>=6,<7",
|
|
33
|
+
"eth-utils>=6,<7",
|
|
34
|
+
"eth-hash[pycryptodome]>=0.8,<0.9",
|
|
35
|
+
"eth-keys>=0.8,<0.9",
|
|
36
|
+
"eth-typing>=6,<7",
|
|
37
|
+
"hexbytes>=1,<3",
|
|
38
|
+
]
|
|
39
|
+
monero = [
|
|
40
|
+
"cryptography>=43,<47",
|
|
41
|
+
"pycryptodome>=3.20,<4",
|
|
42
|
+
]
|
|
43
|
+
all = [
|
|
44
|
+
"embit>=0.8,<0.9",
|
|
45
|
+
"coincurve>=21,<22",
|
|
46
|
+
"eth-abi>=6,<7",
|
|
47
|
+
"eth-utils>=6,<7",
|
|
48
|
+
"eth-hash[pycryptodome]>=0.8,<0.9",
|
|
49
|
+
"eth-keys>=0.8,<0.9",
|
|
50
|
+
"eth-typing>=6,<7",
|
|
51
|
+
"hexbytes>=1,<3",
|
|
52
|
+
"cryptography>=43,<47",
|
|
53
|
+
"pycryptodome>=3.20,<4",
|
|
54
|
+
]
|
|
55
|
+
test = [
|
|
56
|
+
"coverage>=7,<8",
|
|
57
|
+
"hypothesis>=6,<7",
|
|
58
|
+
"pytest>=8,<10",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.hatch.build.targets.wheel]
|
|
62
|
+
packages = ["src/multisig_escrow"]
|
|
63
|
+
exclude = [
|
|
64
|
+
"tests",
|
|
65
|
+
"tools",
|
|
66
|
+
"examples",
|
|
67
|
+
"docs*.md",
|
|
68
|
+
"AUDIT*.md",
|
|
69
|
+
"EXTERNAL_AUDIT_BRIEF.md",
|
|
70
|
+
"STRESS_TEST_REPORT.md",
|
|
71
|
+
"**/target",
|
|
72
|
+
"**/__pycache__",
|
|
73
|
+
"**/*.pyc",
|
|
74
|
+
"**/*.so",
|
|
75
|
+
"**/*.dylib",
|
|
76
|
+
"**/*.dll",
|
|
77
|
+
"**/*.exe",
|
|
78
|
+
"**/*.bin",
|
|
79
|
+
"**/monero_oxide_verify",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
[tool.hatch.build.targets.sdist]
|
|
83
|
+
ignore-vcs = true
|
|
84
|
+
include = [
|
|
85
|
+
"src",
|
|
86
|
+
"README.md",
|
|
87
|
+
"SECURITY.md",
|
|
88
|
+
"LICENSE",
|
|
89
|
+
"pyproject.toml",
|
|
90
|
+
]
|
|
91
|
+
exclude = [
|
|
92
|
+
".venv",
|
|
93
|
+
".gitignore",
|
|
94
|
+
"/.gitignore",
|
|
95
|
+
"**/.gitignore",
|
|
96
|
+
"dist",
|
|
97
|
+
"tests",
|
|
98
|
+
"tools",
|
|
99
|
+
"examples",
|
|
100
|
+
"docs*.md",
|
|
101
|
+
"AUDIT*.md",
|
|
102
|
+
"EXTERNAL_AUDIT_BRIEF.md",
|
|
103
|
+
"STRESS_TEST_REPORT.md",
|
|
104
|
+
"**/__pycache__",
|
|
105
|
+
"**/*.pyc",
|
|
106
|
+
"**/target",
|
|
107
|
+
"**/*.so",
|
|
108
|
+
"**/*.dylib",
|
|
109
|
+
"**/*.dll",
|
|
110
|
+
"**/*.exe",
|
|
111
|
+
"**/*.bin",
|
|
112
|
+
".coverage",
|
|
113
|
+
".hypothesis",
|
|
114
|
+
".mypy_cache",
|
|
115
|
+
".pytest_cache",
|
|
116
|
+
".ruff_cache",
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
[tool.pytest.ini_options]
|
|
120
|
+
pythonpath = ["src"]
|
|
121
|
+
testpaths = ["tests"]
|
|
122
|
+
addopts = "-ra --strict-config --strict-markers"
|
|
123
|
+
filterwarnings = ["error"]
|
|
124
|
+
|
|
125
|
+
[tool.ruff]
|
|
126
|
+
target-version = "py311"
|
|
127
|
+
line-length = 100
|
|
128
|
+
|
|
129
|
+
[tool.ruff.lint]
|
|
130
|
+
select = ["E", "F", "I", "UP", "B", "S"]
|
|
131
|
+
|
|
132
|
+
[tool.ruff.lint.per-file-ignores]
|
|
133
|
+
"tests/*" = ["S101", "S105", "S106", "S603"]
|
|
134
|
+
|
|
135
|
+
[tool.mypy]
|
|
136
|
+
python_version = "3.11"
|
|
137
|
+
strict = true
|
|
138
|
+
mypy_path = "src"
|
|
139
|
+
packages = ["multisig_escrow"]
|
|
140
|
+
|
|
141
|
+
[[tool.mypy.overrides]]
|
|
142
|
+
module = ["embit.*"]
|
|
143
|
+
ignore_missing_imports = true
|
|
144
|
+
|
|
145
|
+
[tool.coverage.run]
|
|
146
|
+
branch = true
|
|
147
|
+
source = ["multisig_escrow"]
|
|
148
|
+
|
|
149
|
+
[tool.coverage.report]
|
|
150
|
+
fail_under = 99
|
|
151
|
+
show_missing = true
|
|
152
|
+
exclude_also = [
|
|
153
|
+
"except ImportError as exc:",
|
|
154
|
+
"raise DependencyError",
|
|
155
|
+
]
|