dethron 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.
Files changed (41) hide show
  1. dethron-0.1.0/LICENSE +202 -0
  2. dethron-0.1.0/NOTICE +9 -0
  3. dethron-0.1.0/PKG-INFO +162 -0
  4. dethron-0.1.0/README.md +134 -0
  5. dethron-0.1.0/pyproject.toml +44 -0
  6. dethron-0.1.0/setup.cfg +4 -0
  7. dethron-0.1.0/src/dethron/__init__.py +28 -0
  8. dethron-0.1.0/src/dethron/adapter.py +75 -0
  9. dethron-0.1.0/src/dethron/assembly.py +86 -0
  10. dethron-0.1.0/src/dethron/audit.py +107 -0
  11. dethron-0.1.0/src/dethron/cli.py +170 -0
  12. dethron-0.1.0/src/dethron/config.py +39 -0
  13. dethron-0.1.0/src/dethron/custody.py +78 -0
  14. dethron-0.1.0/src/dethron/database.py +56 -0
  15. dethron-0.1.0/src/dethron/endpoint.py +171 -0
  16. dethron-0.1.0/src/dethron/erasure.py +42 -0
  17. dethron-0.1.0/src/dethron/handlers.py +133 -0
  18. dethron-0.1.0/src/dethron/lxmf_stamp.py +94 -0
  19. dethron-0.1.0/src/dethron/mailbox.py +81 -0
  20. dethron-0.1.0/src/dethron/node.py +153 -0
  21. dethron-0.1.0/src/dethron/parts.py +59 -0
  22. dethron-0.1.0/src/dethron/protocol.py +97 -0
  23. dethron-0.1.0/src/dethron/receiver.py +55 -0
  24. dethron-0.1.0/src/dethron/wire.py +44 -0
  25. dethron-0.1.0/src/dethron.egg-info/PKG-INFO +162 -0
  26. dethron-0.1.0/src/dethron.egg-info/SOURCES.txt +39 -0
  27. dethron-0.1.0/src/dethron.egg-info/dependency_links.txt +1 -0
  28. dethron-0.1.0/src/dethron.egg-info/entry_points.txt +2 -0
  29. dethron-0.1.0/src/dethron.egg-info/requires.txt +6 -0
  30. dethron-0.1.0/src/dethron.egg-info/top_level.txt +1 -0
  31. dethron-0.1.0/tests/test_adapter.py +29 -0
  32. dethron-0.1.0/tests/test_custody.py +111 -0
  33. dethron-0.1.0/tests/test_erasure.py +54 -0
  34. dethron-0.1.0/tests/test_lxmf_stamp.py +62 -0
  35. dethron-0.1.0/tests/test_mailbox.py +78 -0
  36. dethron-0.1.0/tests/test_node.py +70 -0
  37. dethron-0.1.0/tests/test_parts.py +78 -0
  38. dethron-0.1.0/tests/test_protocol.py +38 -0
  39. dethron-0.1.0/tests/test_roundtrip.py +89 -0
  40. dethron-0.1.0/tests/test_verify.py +79 -0
  41. dethron-0.1.0/tests/test_wire.py +49 -0
dethron-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
dethron-0.1.0/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ Dethron
2
+ Copyright 2026 Dethron contributors
3
+
4
+ This product includes software developed as part of the Dethron project.
5
+
6
+ Licensed under the Apache License, Version 2.0. See the LICENSE file.
7
+
8
+ Dethron builds on Reticulum (RNS) and LXMF, which are separate works under their
9
+ own licenses. They are imported as dependencies, not derived from.
dethron-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: dethron
3
+ Version: 0.1.0
4
+ Summary: Verifiable message delivery over Reticulum and LXMF
5
+ License: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/elSilveira/dethron
7
+ Project-URL: Evidence, https://github.com/elSilveira/dethron/tree/master/evidence
8
+ Project-URL: Research, https://github.com/elSilveira/dethron-research
9
+ Keywords: reticulum,lxmf,mesh,delay-tolerant,messaging,custody
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Communications
17
+ Classifier: Topic :: System :: Networking
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ License-File: NOTICE
22
+ Requires-Dist: rns<2,>=1.5.4
23
+ Requires-Dist: lxmf<2,>=1.1.1
24
+ Requires-Dist: cryptography>=42
25
+ Provides-Extra: serial
26
+ Requires-Dist: pyserial>=3.5; extra == "serial"
27
+ Dynamic: license-file
28
+
29
+ # Dethron
30
+
31
+ Verifiable message delivery over [Reticulum](https://reticulum.network/) and LXMF.
32
+
33
+ **Guaranteed** delivery is impossible over intermittent contact: if the recipient never
34
+ appears, nothing reaches them. What is possible is knowing, with cryptographic proof and
35
+ without trusting the relay, which state a message is in.
36
+
37
+ | State | Proof | Who signs it |
38
+ | --- | --- | --- |
39
+ | **Entered** | A custody attestation naming the message, the recipient, and the bytes actually stored | the relay |
40
+ | **Pending** | A relay holding custody with no receipt: *awaiting contact* or *attested and not delivered* | derived, not claimed |
41
+ | **Left** | A receipt over the exact reconstructed bytes, which reaches the sender through any relay carrying it | the recipient |
42
+
43
+ A relay that attests and then discards the message is **named** by the absence of the
44
+ recipient's receipt. That is the point: nothing here asks you to trust an intermediary.
45
+
46
+ ## Install
47
+
48
+ ```
49
+ pip install dethron
50
+ ```
51
+
52
+ Python 3.10 or newer. Reticulum and LXMF come with it. Exercised on Windows 11 with
53
+ Python 3.10 and on Ubuntu 24.04 with Python 3.12, end-to-end test included.
54
+
55
+ ## Try it
56
+
57
+ Three terminals, or one and some patience. Everything below is real: real Reticulum
58
+ instances, real LXMF propagation, real signatures.
59
+
60
+ ```bash
61
+ # 1. Mint three identities and note their contacts
62
+ dethron identity ./relay
63
+ dethron identity ./alice
64
+ dethron identity ./bob
65
+
66
+ # 2. Run a relay, which holds objects for recipients who are not here yet
67
+ dethron relay ./relay --port 45810
68
+ ```
69
+
70
+ With the relay running, and using the `contact` and `propagation` values it printed:
71
+
72
+ ```bash
73
+ # 3. Alice hands an object to the relay and comes back with proof it was taken
74
+ dethron send ./alice report.pdf \
75
+ --to <bob's contact> \
76
+ --relay 127.0.0.1:45810/<relay propagation> \
77
+ --relay-contact <relay's contact>
78
+
79
+ # 4. Bob, who was not around for any of that, collects and reconstructs it
80
+ dethron fetch ./bob \
81
+ --source <alice's contact> \
82
+ --relay 127.0.0.1:45810/<relay propagation> \
83
+ --receipt-to <alice's contact>
84
+
85
+ # 5. Alice comes back later and picks up the receipt Bob signed
86
+ dethron receipts ./alice --relay 127.0.0.1:45810/<relay propagation>
87
+
88
+ # 6. Either of them recomputes every proof from the files on disk
89
+ dethron verify ./alice
90
+ ```
91
+
92
+ `verify` ends with both halves of the claim:
93
+
94
+ ```json
95
+ {
96
+ "verdict": "pass",
97
+ "checks": [
98
+ { "check": "custody 10019ad5 is signed by the relay that was asked",
99
+ "passed": true, "proves": "entry", "stored_size": 18688 },
100
+ { "check": "receipt 02377a24 is signed by the recipient sent to",
101
+ "passed": true, "proves": "exit",
102
+ "digest": "02377a2438d3a5ab8f90f2bbc0cf67f16d8f1ce89da2d867dec1fc4ea2389070" }
103
+ ]
104
+ }
105
+ ```
106
+
107
+ Alice and Bob were never online at the same time.
108
+
109
+ ## As a library
110
+
111
+ ```python
112
+ from dethron import Node
113
+
114
+ with Node('./alice', peers=['relay.example:45810']) as node:
115
+ handoff = node.send(payload, to=bob_contact, via=relay_propagation)
116
+ proof = node.custody_of(handoff['transient_id'], relay=relay_contact)
117
+ ```
118
+
119
+ Calls are synchronous: `send` returns once the relay has taken the object, `custody_of`
120
+ returns the relay's signed attestation, `fetch` returns once the parts reconstruct. Each
121
+ node writes an `events.jsonl` beside itself — not a log for humans, but the record an
122
+ audit reads afterwards.
123
+
124
+ ## What is proved, and what is not
125
+
126
+ The claims come with artifacts, in [`evidence/`](evidence/README.md), and with documents
127
+ stating the controls that had to fail: see [`docs/`](docs/).
128
+
129
+ Proved, within a declared scope:
130
+
131
+ - Custody, pendency and receipt return ([V1](docs/V1_CUSTODY.md), [receipt](docs/V1_RECEIPT_RETURN.md)).
132
+ - Reproduction on an independent machine following the document alone ([V2](docs/V2_REPRODUCTION.md)).
133
+ - An object crossing between two distinct machines over a link carrying **no IP**,
134
+ with the recipient proved to hold no IP interface ([V3c](docs/V3C_BENCH.md)).
135
+
136
+ Not proved, and not claimed:
137
+
138
+ - **Scale.** One message, one relay, one recipient. No numbers for many peers or a queue.
139
+ - **Key exchange and discovery.** Contacts are exchanged out of band, by you.
140
+ - **A hostile relay in the wild.** The refusals are tested; the adversary is simulated.
141
+ - **Long offline periods.** The sessions in the evidence are disjoint by seconds, not days.
142
+ - **Anything beyond two platforms.** Windows and Linux are exercised; Android, macOS and
143
+ the BSDs are not. The milestone evidence below was produced on Windows, and says so.
144
+ - Everything the milestone documents list under "Limits", which is where to look first.
145
+
146
+ ## Contributing
147
+
148
+ Bug reports and reproductions are the most useful thing you can send. See
149
+ [CONTRIBUTING.md](CONTRIBUTING.md). The house rule is that a claim arrives with the
150
+ control that would have caught it being wrong.
151
+
152
+ ## Where the evidence came from
153
+
154
+ The bench that produced it — generations of nodes, cut media, two-machine schedules, the
155
+ auditors — lives in [dethron-research](https://github.com/elSilveira/dethron-research),
156
+ along with the deliberation and the runs that failed. This repository is the part that is
157
+ meant to be used; that one is the part that is meant to be checked.
158
+
159
+ ## Licence
160
+
161
+ [Apache 2.0](LICENSE). Reticulum and LXMF are dependencies under their own licences; this
162
+ work imports them, it does not derive from them.
@@ -0,0 +1,134 @@
1
+ # Dethron
2
+
3
+ Verifiable message delivery over [Reticulum](https://reticulum.network/) and LXMF.
4
+
5
+ **Guaranteed** delivery is impossible over intermittent contact: if the recipient never
6
+ appears, nothing reaches them. What is possible is knowing, with cryptographic proof and
7
+ without trusting the relay, which state a message is in.
8
+
9
+ | State | Proof | Who signs it |
10
+ | --- | --- | --- |
11
+ | **Entered** | A custody attestation naming the message, the recipient, and the bytes actually stored | the relay |
12
+ | **Pending** | A relay holding custody with no receipt: *awaiting contact* or *attested and not delivered* | derived, not claimed |
13
+ | **Left** | A receipt over the exact reconstructed bytes, which reaches the sender through any relay carrying it | the recipient |
14
+
15
+ A relay that attests and then discards the message is **named** by the absence of the
16
+ recipient's receipt. That is the point: nothing here asks you to trust an intermediary.
17
+
18
+ ## Install
19
+
20
+ ```
21
+ pip install dethron
22
+ ```
23
+
24
+ Python 3.10 or newer. Reticulum and LXMF come with it. Exercised on Windows 11 with
25
+ Python 3.10 and on Ubuntu 24.04 with Python 3.12, end-to-end test included.
26
+
27
+ ## Try it
28
+
29
+ Three terminals, or one and some patience. Everything below is real: real Reticulum
30
+ instances, real LXMF propagation, real signatures.
31
+
32
+ ```bash
33
+ # 1. Mint three identities and note their contacts
34
+ dethron identity ./relay
35
+ dethron identity ./alice
36
+ dethron identity ./bob
37
+
38
+ # 2. Run a relay, which holds objects for recipients who are not here yet
39
+ dethron relay ./relay --port 45810
40
+ ```
41
+
42
+ With the relay running, and using the `contact` and `propagation` values it printed:
43
+
44
+ ```bash
45
+ # 3. Alice hands an object to the relay and comes back with proof it was taken
46
+ dethron send ./alice report.pdf \
47
+ --to <bob's contact> \
48
+ --relay 127.0.0.1:45810/<relay propagation> \
49
+ --relay-contact <relay's contact>
50
+
51
+ # 4. Bob, who was not around for any of that, collects and reconstructs it
52
+ dethron fetch ./bob \
53
+ --source <alice's contact> \
54
+ --relay 127.0.0.1:45810/<relay propagation> \
55
+ --receipt-to <alice's contact>
56
+
57
+ # 5. Alice comes back later and picks up the receipt Bob signed
58
+ dethron receipts ./alice --relay 127.0.0.1:45810/<relay propagation>
59
+
60
+ # 6. Either of them recomputes every proof from the files on disk
61
+ dethron verify ./alice
62
+ ```
63
+
64
+ `verify` ends with both halves of the claim:
65
+
66
+ ```json
67
+ {
68
+ "verdict": "pass",
69
+ "checks": [
70
+ { "check": "custody 10019ad5 is signed by the relay that was asked",
71
+ "passed": true, "proves": "entry", "stored_size": 18688 },
72
+ { "check": "receipt 02377a24 is signed by the recipient sent to",
73
+ "passed": true, "proves": "exit",
74
+ "digest": "02377a2438d3a5ab8f90f2bbc0cf67f16d8f1ce89da2d867dec1fc4ea2389070" }
75
+ ]
76
+ }
77
+ ```
78
+
79
+ Alice and Bob were never online at the same time.
80
+
81
+ ## As a library
82
+
83
+ ```python
84
+ from dethron import Node
85
+
86
+ with Node('./alice', peers=['relay.example:45810']) as node:
87
+ handoff = node.send(payload, to=bob_contact, via=relay_propagation)
88
+ proof = node.custody_of(handoff['transient_id'], relay=relay_contact)
89
+ ```
90
+
91
+ Calls are synchronous: `send` returns once the relay has taken the object, `custody_of`
92
+ returns the relay's signed attestation, `fetch` returns once the parts reconstruct. Each
93
+ node writes an `events.jsonl` beside itself — not a log for humans, but the record an
94
+ audit reads afterwards.
95
+
96
+ ## What is proved, and what is not
97
+
98
+ The claims come with artifacts, in [`evidence/`](evidence/README.md), and with documents
99
+ stating the controls that had to fail: see [`docs/`](docs/).
100
+
101
+ Proved, within a declared scope:
102
+
103
+ - Custody, pendency and receipt return ([V1](docs/V1_CUSTODY.md), [receipt](docs/V1_RECEIPT_RETURN.md)).
104
+ - Reproduction on an independent machine following the document alone ([V2](docs/V2_REPRODUCTION.md)).
105
+ - An object crossing between two distinct machines over a link carrying **no IP**,
106
+ with the recipient proved to hold no IP interface ([V3c](docs/V3C_BENCH.md)).
107
+
108
+ Not proved, and not claimed:
109
+
110
+ - **Scale.** One message, one relay, one recipient. No numbers for many peers or a queue.
111
+ - **Key exchange and discovery.** Contacts are exchanged out of band, by you.
112
+ - **A hostile relay in the wild.** The refusals are tested; the adversary is simulated.
113
+ - **Long offline periods.** The sessions in the evidence are disjoint by seconds, not days.
114
+ - **Anything beyond two platforms.** Windows and Linux are exercised; Android, macOS and
115
+ the BSDs are not. The milestone evidence below was produced on Windows, and says so.
116
+ - Everything the milestone documents list under "Limits", which is where to look first.
117
+
118
+ ## Contributing
119
+
120
+ Bug reports and reproductions are the most useful thing you can send. See
121
+ [CONTRIBUTING.md](CONTRIBUTING.md). The house rule is that a claim arrives with the
122
+ control that would have caught it being wrong.
123
+
124
+ ## Where the evidence came from
125
+
126
+ The bench that produced it — generations of nodes, cut media, two-machine schedules, the
127
+ auditors — lives in [dethron-research](https://github.com/elSilveira/dethron-research),
128
+ along with the deliberation and the runs that failed. This repository is the part that is
129
+ meant to be used; that one is the part that is meant to be checked.
130
+
131
+ ## Licence
132
+
133
+ [Apache 2.0](LICENSE). Reticulum and LXMF are dependencies under their own licences; this
134
+ work imports them, it does not derive from them.
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dethron"
7
+ version = "0.1.0"
8
+ description = "Verifiable message delivery over Reticulum and LXMF"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "Apache-2.0" }
12
+ keywords = ["reticulum", "lxmf", "mesh", "delay-tolerant", "messaging", "custody"]
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: Apache Software License",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Topic :: Communications",
21
+ "Topic :: System :: Networking",
22
+ ]
23
+ dependencies = [
24
+ "rns>=1.5.4,<2",
25
+ "lxmf>=1.1.1,<2",
26
+ "cryptography>=42",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ serial = ["pyserial>=3.5"]
31
+
32
+ [project.scripts]
33
+ dethron = "dethron.cli:main"
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/elSilveira/dethron"
37
+ Evidence = "https://github.com/elSilveira/dethron/tree/master/evidence"
38
+ Research = "https://github.com/elSilveira/dethron-research"
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.pytest.ini_options]
44
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,28 @@
1
+ """Verifiable message delivery over Reticulum and LXMF.
2
+
3
+ Guaranteed delivery is impossible over intermittent contact: if the recipient never
4
+ appears, nothing reaches them. What is possible is knowing, with cryptographic proof and
5
+ without trusting the relay, which state a message is in — it entered the network, it is
6
+ pending at a named relay, or the recipient signed for it.
7
+
8
+ from dethron import Node
9
+
10
+ with Node('./alice', peers=['relay.example:45810']) as node:
11
+ handoff = node.send(payload, to=recipient, via=relay_propagation)
12
+ proof = node.custody_of(handoff['transient_id'], relay=relay_contact)
13
+
14
+ `proof` is the relay's signature over the message it is holding, for that recipient. It
15
+ proves entry, not delivery: only the recipient's receipt proves exit, and a relay that
16
+ attests and then discards is named by the absence of that receipt.
17
+ """
18
+ from . import custody
19
+ from .audit import verify_directory
20
+ from .endpoint import Endpoint
21
+ from .node import Node, parse_contact, parse_relay
22
+ from .protocol import data_envelope, decode, encode, receipt_envelope
23
+ from .wire import authenticate, declared_expiry
24
+
25
+ __version__ = '0.1.0'
26
+ __all__ = ['Endpoint', 'Node', 'authenticate', 'custody', 'data_envelope', 'decode',
27
+ 'declared_expiry', 'encode', 'parse_contact', 'parse_relay', 'receipt_envelope',
28
+ 'verify_directory']
@@ -0,0 +1,75 @@
1
+ """LXMF direct delivery adapter. pump() is explicit; no simulated network fallback."""
2
+ import threading
3
+ import time
4
+
5
+ import LXMF
6
+ import RNS
7
+
8
+ from .protocol import APPLICATION, encode
9
+ from .wire import authenticate
10
+
11
+
12
+ class Adapter:
13
+ def __init__(self, router, source, mailbox, emit):
14
+ self.router, self.source, self.mailbox, self.emit = router, source, mailbox, emit
15
+ self.active = set()
16
+ self.lock = threading.RLock()
17
+ router.register_delivery_callback(self.receive)
18
+
19
+ def receive(self, message):
20
+ try:
21
+ identity = RNS.Identity.recall(message.source_hash)
22
+ if identity is None:
23
+ raise ValueError("unknown source identity")
24
+ obj = authenticate(message.packed, identity.get_public_key(), self.source.hash.hex(), time.time())
25
+ fresh = self.mailbox.accept_verified(obj, message.packed, time.time())
26
+ self.emit("confirmed" if obj["kind"] == "receipt" else "received",
27
+ id=obj["id"], fresh=fresh, digest=obj["digest"])
28
+ except Exception as exc:
29
+ self.emit("rejected", error=repr(exc))
30
+
31
+ def transmit(self, destination, body, callback=None, failed=None):
32
+ dest_hash = bytes.fromhex(destination)
33
+ identity = RNS.Identity.recall(dest_hash)
34
+ if identity is None:
35
+ RNS.Transport.request_path(dest_hash)
36
+ return False
37
+ target = RNS.Destination(identity, RNS.Destination.OUT, RNS.Destination.SINGLE, "lxmf", "delivery")
38
+ message = LXMF.LXMessage(target, self.source, body, APPLICATION, desired_method=LXMF.LXMessage.DIRECT)
39
+ if callback:
40
+ message.register_delivery_callback(callback)
41
+ if failed:
42
+ message.register_failed_callback(failed)
43
+ self.router.handle_outbound(message)
44
+ return True
45
+
46
+ def _complete(self, key, message_id, succeeded):
47
+ with self.lock:
48
+ if succeeded:
49
+ self.mailbox.handoff(key)
50
+ self.active.discard(key)
51
+ self.emit("handoff" if succeeded else "attempt_failed", id=message_id)
52
+
53
+ def pump(self):
54
+ with self.lock:
55
+ for item in self.mailbox.pending(time.time()):
56
+ key, obj = item["key"], item["envelope"]
57
+ if key in self.active:
58
+ continue
59
+ dest_hash = bytes.fromhex(obj["destination"])
60
+ # Native LXMF can reuse a backchannel even without a cached route.
61
+ if RNS.Identity.recall(dest_hash) is None:
62
+ RNS.Transport.request_path(dest_hash)
63
+ self.emit("no_path", id=obj["id"])
64
+ continue
65
+ self.mailbox.begin_attempt(key, time.time())
66
+ self.active.add(key)
67
+ success = lambda m, k=key, i=obj["id"]: self._complete(k, i, True)
68
+ failure = lambda m, k=key, i=obj["id"]: self._complete(k, i, False)
69
+ try:
70
+ sent = self.transmit(obj["destination"], encode(obj), success, failure)
71
+ if not sent:
72
+ self.active.discard(key)
73
+ except Exception:
74
+ self.active.discard(key)
75
+ raise