multisig 0.1.0__py3-none-any.whl

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.
Files changed (70) hide show
  1. multisig-0.1.0.dist-info/METADATA +188 -0
  2. multisig-0.1.0.dist-info/RECORD +70 -0
  3. multisig-0.1.0.dist-info/WHEEL +4 -0
  4. multisig-0.1.0.dist-info/licenses/LICENSE +21 -0
  5. multisig_escrow/__init__.py +152 -0
  6. multisig_escrow/authenticity.py +45 -0
  7. multisig_escrow/bitcoin/__init__.py +124 -0
  8. multisig_escrow/bitcoin/addresses.py +103 -0
  9. multisig_escrow/bitcoin/assets.py +29 -0
  10. multisig_escrow/bitcoin/descriptor.py +211 -0
  11. multisig_escrow/bitcoin/fees.py +282 -0
  12. multisig_escrow/bitcoin/finalize.py +271 -0
  13. multisig_escrow/bitcoin/funding.py +153 -0
  14. multisig_escrow/bitcoin/keys.py +209 -0
  15. multisig_escrow/bitcoin/params.py +66 -0
  16. multisig_escrow/bitcoin/policy.py +158 -0
  17. multisig_escrow/bitcoin/psbt.py +241 -0
  18. multisig_escrow/bitcoin/timelock.py +166 -0
  19. multisig_escrow/bitcoin/verify.py +709 -0
  20. multisig_escrow/core/__init__.py +134 -0
  21. multisig_escrow/core/amounts.py +24 -0
  22. multisig_escrow/core/capabilities.py +273 -0
  23. multisig_escrow/core/codec.py +122 -0
  24. multisig_escrow/core/errors.py +104 -0
  25. multisig_escrow/core/ids.py +56 -0
  26. multisig_escrow/core/protocol.py +46 -0
  27. multisig_escrow/core/roles.py +196 -0
  28. multisig_escrow/core/terms.py +437 -0
  29. multisig_escrow/core/time.py +73 -0
  30. multisig_escrow/core/validation.py +127 -0
  31. multisig_escrow/evm/__init__.py +97 -0
  32. multisig_escrow/evm/addresses.py +72 -0
  33. multisig_escrow/evm/assets.py +76 -0
  34. multisig_escrow/evm/calldata.py +142 -0
  35. multisig_escrow/evm/deployment.py +201 -0
  36. multisig_escrow/evm/eip712.py +138 -0
  37. multisig_escrow/evm/funding.py +89 -0
  38. multisig_escrow/evm/params.py +38 -0
  39. multisig_escrow/evm/payouts.py +66 -0
  40. multisig_escrow/evm/plan.py +63 -0
  41. multisig_escrow/evm/safe.py +236 -0
  42. multisig_escrow/evm/signatures.py +181 -0
  43. multisig_escrow/evm/verify.py +732 -0
  44. multisig_escrow/facade.py +2532 -0
  45. multisig_escrow/fsm/__init__.py +95 -0
  46. multisig_escrow/fsm/events.py +95 -0
  47. multisig_escrow/fsm/invariants.py +287 -0
  48. multisig_escrow/fsm/machine.py +547 -0
  49. multisig_escrow/fsm/plan.py +24 -0
  50. multisig_escrow/fsm/record.py +271 -0
  51. multisig_escrow/fsm/serialize.py +453 -0
  52. multisig_escrow/fsm/states.py +86 -0
  53. multisig_escrow/fsm/tokens.py +466 -0
  54. multisig_escrow/monero/__init__.py +86 -0
  55. multisig_escrow/monero/adapter.py +741 -0
  56. multisig_escrow/monero/addresses.py +144 -0
  57. multisig_escrow/monero/approval.py +149 -0
  58. multisig_escrow/monero/crypto.py +234 -0
  59. multisig_escrow/monero/facade.py +610 -0
  60. multisig_escrow/monero/funding.py +217 -0
  61. multisig_escrow/monero/key_images.py +49 -0
  62. multisig_escrow/monero/keys.py +53 -0
  63. multisig_escrow/monero/manifest.py +103 -0
  64. multisig_escrow/monero/multisig.py +55 -0
  65. multisig_escrow/monero/params.py +76 -0
  66. multisig_escrow/monero/refund.py +119 -0
  67. multisig_escrow/monero/settlement.py +299 -0
  68. multisig_escrow/monero/terms.py +216 -0
  69. multisig_escrow/py.typed +0 -0
  70. multisig_escrow/store.py +115 -0
@@ -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).
@@ -0,0 +1,70 @@
1
+ multisig_escrow/__init__.py,sha256=9eDRMrOD7PF88NDNi8vc_VwUU5kfnCXWO9F6i7ZGLwk,2888
2
+ multisig_escrow/authenticity.py,sha256=4_qxzSYcAcvafQlWmLCj7AzF8KaRNpoAcjijltqLkyA,1537
3
+ multisig_escrow/facade.py,sha256=pu0hF5Mgh0jB5ojeaq9i6yV_xW8p2x8IE-yePjolZ5M,86980
4
+ multisig_escrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ multisig_escrow/store.py,sha256=_-TSOgE7vkHp6OJBJXzz-dy1lq9Epu4t73G1V0uKkXM,3591
6
+ multisig_escrow/bitcoin/__init__.py,sha256=uPC5iNUuX1EH04Y2HcTTGdhLu9h_pjv47oK1Mxc09Pw,2915
7
+ multisig_escrow/bitcoin/addresses.py,sha256=LdjAncemHvdAnf4f8O4pwECbLSOyITpCfDPKbteFkeg,3504
8
+ multisig_escrow/bitcoin/assets.py,sha256=MoS0McNkOjm54rIRIKrQgJ5x9KissDTVQTODSxBgs-4,836
9
+ multisig_escrow/bitcoin/descriptor.py,sha256=_cxw5IVVUbFvGLndXETMitgzgyxODRzl-qOqjKVpMX4,7254
10
+ multisig_escrow/bitcoin/fees.py,sha256=Kq2m_NgFYDwmYcslCbAUE0vtGehTPSdhStJB9wsQu3Y,9277
11
+ multisig_escrow/bitcoin/finalize.py,sha256=OKiNBj0c7Npt1w8VeMfAhXPPMrUqXRAR7_5OHj08PGw,9250
12
+ multisig_escrow/bitcoin/funding.py,sha256=D2BrcrFaXjW8InDRO40oyXIo5TZNYAJliK_-SPTiFmo,5276
13
+ multisig_escrow/bitcoin/keys.py,sha256=UfoAYDtSnwXE1IXgGjIQW6vjy73jg0ld561e0WQyYHo,6474
14
+ multisig_escrow/bitcoin/params.py,sha256=Ld3wF5l44m4aUYa4vztd--35fQgVbl-artOmnzs4AGA,1948
15
+ multisig_escrow/bitcoin/policy.py,sha256=bNpFsRss4XiJtnqAK-WdOcxCxl1oEpSbgrCmv0fE6Ek,6046
16
+ multisig_escrow/bitcoin/psbt.py,sha256=T_cF_Dx5Q_0stSurqKGQett2_BX575euMMD92D7Uo-o,8500
17
+ multisig_escrow/bitcoin/timelock.py,sha256=l2zUa9sxx1Ml0LZ86b4Qo0e0fcA07x3OhaZhB6BvpUk,5113
18
+ multisig_escrow/bitcoin/verify.py,sha256=XRA7cAy4UcSyFKzUcJRJDf5FLC9fbTUEDgScBKo9JJg,24309
19
+ multisig_escrow/core/__init__.py,sha256=OnVX_SN7HxqQxxKmKIKA-P2zboi9zmwJkaffQMBa8vA,2778
20
+ multisig_escrow/core/amounts.py,sha256=xnxsnHPC-BJ78DuGS9MiGVSHs8HMXh91LQPBbYWF5po,667
21
+ multisig_escrow/core/capabilities.py,sha256=vCp5wzk2Kd_WW_Aj7HY4HVnWn-V1qoVLmIwvD0CK0x0,9166
22
+ multisig_escrow/core/codec.py,sha256=NPWmWsZmoCJeXv29jjo_7lbDG7jnYhXLGlEU2Sq4_ig,3372
23
+ multisig_escrow/core/errors.py,sha256=PCr00YXz5Qg0z_sVxRCg4OBHrBxb8MoyEKM-EzbFIw8,1899
24
+ multisig_escrow/core/ids.py,sha256=GOdu4TDNjsXbcBLgycq7NqoLmp_gSoMWqCuVflW29lA,1285
25
+ multisig_escrow/core/protocol.py,sha256=DnUCM1JoO0T-_FYRbZO_Lhl7qOptf7N_efjnSE30OBY,901
26
+ multisig_escrow/core/roles.py,sha256=S0BwVEzaxY7YQtpsdr55jbzj0ZZ3Gc4IylPx35RGPpY,6435
27
+ multisig_escrow/core/terms.py,sha256=3V5W2Q7Yd3l9xwFqAKkcIQhWzouzDIlS6STHG7ZSA9o,16018
28
+ multisig_escrow/core/time.py,sha256=WLkHLpILaf0Ebd7oW2TgvPb927u8oJ4mvhO6SCJCBps,1913
29
+ multisig_escrow/core/validation.py,sha256=LdE1T7E01qPJstAklAt7A-FSUBOX-E4-96sQkANJC1w,3547
30
+ multisig_escrow/evm/__init__.py,sha256=H0-GzcRSdGqurIS_3r9frNC3h4pZt8qwj2oT83pXir8,2429
31
+ multisig_escrow/evm/addresses.py,sha256=IgZiPn-h9kLaEs56x96MzVMAOazQjTzjPIObvYSJpaE,1975
32
+ multisig_escrow/evm/assets.py,sha256=u0As2rxujl65qhjskjOsGYiST60Vb1rGmyamcDzdOno,2193
33
+ multisig_escrow/evm/calldata.py,sha256=SeQ7ngP87iihfVVbUiqWEkbA3RX9-zdvmLWayBSKL4k,4297
34
+ multisig_escrow/evm/deployment.py,sha256=KbwxrsPP9gJaagQIuwxUq1qADy5_-nERyJLiq-WZF9U,6654
35
+ multisig_escrow/evm/eip712.py,sha256=4ar2xCqrJ4psqSdZnhL8IPX1zMj-9n-3rbo5gy23_BA,3725
36
+ multisig_escrow/evm/funding.py,sha256=32VX8_lsF9MiFejrbhxAvgUCxBixSALEpOlh2it8leY,2922
37
+ multisig_escrow/evm/params.py,sha256=QPKzb59OcZ3h0biMjwdusLPODEWsz5jBVCrqpPhi0ec,842
38
+ multisig_escrow/evm/payouts.py,sha256=A3nVuRnjlh5dByJXGgEMeqq6qb4Qpc6S60Xwi7QA8OA,1810
39
+ multisig_escrow/evm/plan.py,sha256=yuACbLg5VPIYgeICSYS6eQJK1-TFd9OOBwoMY86qOzQ,2117
40
+ multisig_escrow/evm/safe.py,sha256=kz-MV8rDW1zGIuSZQPBUvDVocfIBqqr0EqwZAp773cs,8176
41
+ multisig_escrow/evm/signatures.py,sha256=QLEBkEenOWn_2tGMcZR1QZnS3gr4pwXt_sLT02nMgak,5689
42
+ multisig_escrow/evm/verify.py,sha256=jQZTv6xtpcq6d1jpQ7jRumzeOqHf-cqLFjOy3vft6Ro,22512
43
+ multisig_escrow/fsm/__init__.py,sha256=2EnNkjMBiT20tjR5jFwcrhQqgqn0Q8OPuBmWDFUdY_E,1635
44
+ multisig_escrow/fsm/events.py,sha256=xFGz8V29QmZ1mVmpzI90WlrHfVik2aHfw4HVqV3x5_c,1485
45
+ multisig_escrow/fsm/invariants.py,sha256=3zWlelQnHoYiZP0v9DY2F43_IKGJblZFeaGilZZan-Y,11633
46
+ multisig_escrow/fsm/machine.py,sha256=LShYVYXFf3hWOHAmNsXEzsr57neXpsH3NLHJKL0vUPQ,18350
47
+ multisig_escrow/fsm/plan.py,sha256=qPwFyD0fnpyWVkVYlQ1CbwqzBvtVgDMGBcVWK9CsKBs,556
48
+ multisig_escrow/fsm/record.py,sha256=cfVbpPrzrus9dGR-H1ZElF28CjB7fENFk9cdZzpvaTg,9051
49
+ multisig_escrow/fsm/serialize.py,sha256=R5pMREn2FL15bfJ7VqtRvzORv77JurtmOYVcGm4Zj5U,16030
50
+ multisig_escrow/fsm/states.py,sha256=iJQzfbE6C0fCsy3LmG8YL2nTJejrFhLc1eMMB7_Ewnc,1856
51
+ multisig_escrow/fsm/tokens.py,sha256=WQSHW0Aod8neXuaKOAbxA8_xQfupE1MCrmWYAgo0rAc,15271
52
+ multisig_escrow/monero/__init__.py,sha256=spLqkuGaD8ZN1xFeKGzajrvAHxnYEUeFCS7hPCq6W_g,2309
53
+ multisig_escrow/monero/adapter.py,sha256=hNiL1aQ3lcWXrK_c6oF6Cz6IUcFdFykTgSRMaRiGpj0,27093
54
+ multisig_escrow/monero/addresses.py,sha256=M7R73auqGfm-yvhUzg99UhjfxN_NmZxmBUi9xnTFQv4,4446
55
+ multisig_escrow/monero/approval.py,sha256=vNbPaZosFC4o_3TVDGeDr9Hn5YPLa1inI7oJSu22k-w,5194
56
+ multisig_escrow/monero/crypto.py,sha256=xvFJ9IESaVYgTKkF0FLQR1beu_ZperOCkvNVe6Leij0,7970
57
+ multisig_escrow/monero/facade.py,sha256=KJRLE_-8uv5Tghnv3J2sdWN2be_mdfiJvmBnBUUi9OA,20268
58
+ multisig_escrow/monero/funding.py,sha256=-TFlcpwjInk73TPUSjcZbDCfKdT42vq8KDlE-Wsn6tE,7494
59
+ multisig_escrow/monero/key_images.py,sha256=znBJeHMasbWC02RO5Oh16pHAB3jwivdQ6BXmNKcXU_4,1459
60
+ multisig_escrow/monero/keys.py,sha256=5YCj_3VDlZoIiwQ4_TktDOsbs3mlkoSAQ76jA-NpNlM,1695
61
+ multisig_escrow/monero/manifest.py,sha256=zhkZM2Ywfe67QEBoinP5ht46hasv6T7o1gl_36l_QSw,2632
62
+ multisig_escrow/monero/multisig.py,sha256=l_5nKLCEb3wkzYh96WBXCgTUqHAv89CcvRWreI7CY3M,2339
63
+ multisig_escrow/monero/params.py,sha256=NS79K5i32wJe27VxzE0oIEW8mgtNML6Zfg5z71TcT98,2341
64
+ multisig_escrow/monero/refund.py,sha256=oCiYCxOQ9oQCwLWUaTSuhiLJWeo_xiXBTRyiQpyo_30,4302
65
+ multisig_escrow/monero/settlement.py,sha256=P6E_MbFwkckGbJYAmXz14tvKVYECv7v6EOn79Fva7vQ,10378
66
+ multisig_escrow/monero/terms.py,sha256=mDwHqDdgllRcyVELYPJjguLY8Pwanpabv05BqdfCXO0,8080
67
+ multisig-0.1.0.dist-info/METADATA,sha256=dVrIUyrjGryaskrVLTVRFHgW-eYKxPWhfu0zK3jf_zA,7293
68
+ multisig-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
69
+ multisig-0.1.0.dist-info/licenses/LICENSE,sha256=oEtpMwQZPEJXD6dYohsOW59C3sLj4qbFL6W1BIWHwA0,1085
70
+ multisig-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -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.
@@ -0,0 +1,152 @@
1
+ from __future__ import annotations
2
+
3
+ from .authenticity import require_trusted_terms
4
+ from .core import (
5
+ AdapterCapabilities,
6
+ AdapterManifest,
7
+ Asset,
8
+ CapabilityError,
9
+ ChainFamily,
10
+ ChainReader,
11
+ ChainTip,
12
+ CodecError,
13
+ ConfirmationPolicy,
14
+ ConformanceError,
15
+ DependencyError,
16
+ DisputePolicy,
17
+ EscrowError,
18
+ EscrowId,
19
+ EscrowTerms,
20
+ EvidenceContext,
21
+ FeePolicy,
22
+ FinalityModel,
23
+ FreshnessError,
24
+ FundingError,
25
+ NetworkMismatchError,
26
+ NonceError,
27
+ OfflineSigningCapability,
28
+ ParserError,
29
+ Payout,
30
+ PolicyError,
31
+ ProposalId,
32
+ QuorumPolicy,
33
+ RecoveryPolicy,
34
+ ResidualRiskDeclaration,
35
+ Role,
36
+ SettlementError,
37
+ Severity,
38
+ SignatureError,
39
+ Signer,
40
+ SignerId,
41
+ StateError,
42
+ TermsError,
43
+ TermsVersion,
44
+ TimelockError,
45
+ TimelockModel,
46
+ TransitionError,
47
+ ValidationError,
48
+ VerificationCapability,
49
+ VerificationError,
50
+ )
51
+ from .facade import (
52
+ BitcoinEscrow,
53
+ BroadcastEvidence,
54
+ ChainAdapter,
55
+ Clock,
56
+ Escrow,
57
+ EscrowSummary,
58
+ EvmEscrow,
59
+ FinalizedSettlement,
60
+ ProposalSummary,
61
+ SettlementProposal,
62
+ SystemClock,
63
+ )
64
+ from .fsm import (
65
+ EscrowRecord,
66
+ SettlementAction,
67
+ SettlementPath,
68
+ Status,
69
+ TokenBinding,
70
+ )
71
+ from .store import (
72
+ InMemoryStore,
73
+ MemoryStore,
74
+ Store,
75
+ StoreConflictError,
76
+ StoreError,
77
+ StoreNotFoundError,
78
+ )
79
+
80
+ __version__ = "0.1.0"
81
+
82
+ __all__ = [
83
+ "AdapterCapabilities",
84
+ "AdapterManifest",
85
+ "Asset",
86
+ "CapabilityError",
87
+ "ChainFamily",
88
+ "ChainTip",
89
+ "ConformanceError",
90
+ "EvidenceContext",
91
+ "FinalityModel",
92
+ "FreshnessError",
93
+ "OfflineSigningCapability",
94
+ "ResidualRiskDeclaration",
95
+ "Severity",
96
+ "TimelockModel",
97
+ "VerificationCapability",
98
+ "BitcoinEscrow",
99
+ "BroadcastEvidence",
100
+ "ChainAdapter",
101
+ "ChainReader",
102
+ "Clock",
103
+ "CodecError",
104
+ "ConfirmationPolicy",
105
+ "DependencyError",
106
+ "DisputePolicy",
107
+ "Escrow",
108
+ "EscrowError",
109
+ "EscrowId",
110
+ "EscrowRecord",
111
+ "EscrowSummary",
112
+ "EscrowTerms",
113
+ "EvmEscrow",
114
+ "FeePolicy",
115
+ "FinalizedSettlement",
116
+ "FundingError",
117
+ "InMemoryStore",
118
+ "MemoryStore",
119
+ "NetworkMismatchError",
120
+ "NonceError",
121
+ "ParserError",
122
+ "Payout",
123
+ "PolicyError",
124
+ "ProposalId",
125
+ "ProposalSummary",
126
+ "QuorumPolicy",
127
+ "RecoveryPolicy",
128
+ "Role",
129
+ "SettlementAction",
130
+ "SettlementError",
131
+ "SettlementPath",
132
+ "SettlementProposal",
133
+ "SignatureError",
134
+ "Signer",
135
+ "SignerId",
136
+ "StateError",
137
+ "require_trusted_terms",
138
+ "Status",
139
+ "Store",
140
+ "StoreConflictError",
141
+ "StoreError",
142
+ "StoreNotFoundError",
143
+ "SystemClock",
144
+ "TermsError",
145
+ "TokenBinding",
146
+ "TermsVersion",
147
+ "TimelockError",
148
+ "TransitionError",
149
+ "ValidationError",
150
+ "VerificationError",
151
+ "__version__",
152
+ ]
@@ -0,0 +1,45 @@
1
+ """Terms authenticity helpers.
2
+
3
+ The store is a consistency layer, not a trust anchor. A persisted record's
4
+ ``terms_hash`` is self-consistent, but it is not authenticated unless the
5
+ caller compares it with a trusted value kept outside the store.
6
+
7
+ Safe reload pattern::
8
+
9
+ escrow = BitcoinEscrow.load(escrow_id, store=store, clock=clock)
10
+ require_trusted_terms(escrow.record, trusted_terms_hash)
11
+
12
+ Call this on every load before using the record or accepting evidence.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import hmac
18
+
19
+ from .core.errors import TermsError, ValidationError
20
+ from .core.validation import require_hash
21
+ from .fsm.record import EscrowRecord
22
+
23
+ __all__ = ["require_trusted_terms"]
24
+
25
+
26
+ def require_trusted_terms(
27
+ record: EscrowRecord,
28
+ trusted_terms_hash: bytes,
29
+ ) -> EscrowRecord:
30
+ """Reject a record unless its terms hash matches an external trust anchor.
31
+
32
+ ``trusted_terms_hash`` must be persisted outside the mutable store, for
33
+ example in a signed terms manifest, configuration system, or an
34
+ append-only audit log. The helper does not make the store trusted; it only
35
+ makes the caller's external anchor explicit.
36
+ """
37
+
38
+ if not isinstance(record, EscrowRecord):
39
+ raise ValidationError("record")
40
+ trusted = require_hash(trusted_terms_hash, "trusted terms hash")
41
+ if record.terms_hash != record.terms.terms_hash:
42
+ raise TermsError("record terms hash")
43
+ if not hmac.compare_digest(record.terms_hash, trusted):
44
+ raise TermsError("terms not trusted")
45
+ return record
@@ -0,0 +1,124 @@
1
+ from __future__ import annotations
2
+
3
+ from ..facade import BitcoinEscrow
4
+ from .addresses import BtcPayout, address_to_script, script_to_address
5
+ from .assets import BtcAsset
6
+ from .descriptor import (
7
+ build_multisig_descriptor,
8
+ descriptor_address,
9
+ descriptor_checksum,
10
+ descriptor_redeem_script,
11
+ descriptor_script_pubkey,
12
+ descriptor_witness_script,
13
+ parse_descriptor,
14
+ sort_public_keys,
15
+ validate_descriptor_checksum,
16
+ with_checksum,
17
+ witness_script_address,
18
+ witness_script_redeem_script,
19
+ witness_script_script_pubkey,
20
+ )
21
+ from .fees import (
22
+ BitcoinFeePolicy,
23
+ FeeBounds,
24
+ VsizeEstimate,
25
+ dust_rate,
26
+ dust_threshold,
27
+ estimate_vsize,
28
+ fee_bounds,
29
+ is_dust,
30
+ output_dust,
31
+ validate_fee,
32
+ vsize_bounds,
33
+ )
34
+ from .finalize import (
35
+ FinalizedBitcoinSettlement,
36
+ finalize_psbt,
37
+ verify_final_transaction,
38
+ )
39
+ from .funding import (
40
+ BitcoinFundingEvidence,
41
+ BitcoinFundingTarget,
42
+ BtcUtxo,
43
+ validate_funding,
44
+ )
45
+ from .keys import BitcoinChain, BitcoinNetwork, BtcSigner, network_data
46
+ from .params import BtcRefundParams, BtcReleaseParams, PsbtApproval, PsbtSigner
47
+ from .policy import BitcoinPolicy
48
+ from .psbt import BitcoinSettlementPlan, build_settlement_psbt
49
+ from .timelock import (
50
+ CsvDelay,
51
+ CsvUnit,
52
+ TimelockMaturity,
53
+ TimelockRefund,
54
+ build_timelock_script,
55
+ validate_maturity,
56
+ )
57
+ from .verify import (
58
+ PsbtInputSummary,
59
+ PsbtOutputSummary,
60
+ PsbtVerification,
61
+ combine_psbts,
62
+ verify_psbt,
63
+ )
64
+
65
+ __all__ = [
66
+ "BitcoinChain",
67
+ "BitcoinEscrow",
68
+ "BitcoinFeePolicy",
69
+ "BitcoinFundingEvidence",
70
+ "BitcoinFundingTarget",
71
+ "BitcoinNetwork",
72
+ "BitcoinPolicy",
73
+ "BitcoinSettlementPlan",
74
+ "BtcAsset",
75
+ "BtcPayout",
76
+ "BtcRefundParams",
77
+ "BtcReleaseParams",
78
+ "BtcSigner",
79
+ "BtcUtxo",
80
+ "CsvDelay",
81
+ "CsvUnit",
82
+ "FeeBounds",
83
+ "FinalizedBitcoinSettlement",
84
+ "PsbtApproval",
85
+ "PsbtInputSummary",
86
+ "PsbtOutputSummary",
87
+ "PsbtSigner",
88
+ "PsbtVerification",
89
+ "TimelockMaturity",
90
+ "TimelockRefund",
91
+ "VsizeEstimate",
92
+ "address_to_script",
93
+ "build_multisig_descriptor",
94
+ "build_settlement_psbt",
95
+ "build_timelock_script",
96
+ "combine_psbts",
97
+ "descriptor_address",
98
+ "descriptor_checksum",
99
+ "descriptor_redeem_script",
100
+ "descriptor_script_pubkey",
101
+ "descriptor_witness_script",
102
+ "dust_rate",
103
+ "dust_threshold",
104
+ "estimate_vsize",
105
+ "fee_bounds",
106
+ "finalize_psbt",
107
+ "is_dust",
108
+ "network_data",
109
+ "output_dust",
110
+ "parse_descriptor",
111
+ "script_to_address",
112
+ "sort_public_keys",
113
+ "validate_descriptor_checksum",
114
+ "validate_fee",
115
+ "validate_funding",
116
+ "validate_maturity",
117
+ "verify_final_transaction",
118
+ "verify_psbt",
119
+ "vsize_bounds",
120
+ "with_checksum",
121
+ "witness_script_address",
122
+ "witness_script_redeem_script",
123
+ "witness_script_script_pubkey",
124
+ ]