tamga-protocol 0.2.0rc1__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.
- tamga_protocol-0.2.0rc1/LICENSE +202 -0
- tamga_protocol-0.2.0rc1/PKG-INFO +119 -0
- tamga_protocol-0.2.0rc1/README.md +201 -0
- tamga_protocol-0.2.0rc1/docs/QUICKSTART.md +102 -0
- tamga_protocol-0.2.0rc1/pyproject.toml +27 -0
- tamga_protocol-0.2.0rc1/setup.cfg +4 -0
- tamga_protocol-0.2.0rc1/tamga_bootstrap.py +178 -0
- tamga_protocol-0.2.0rc1/tamga_bundle.py +150 -0
- tamga_protocol-0.2.0rc1/tamga_net_shim.py +213 -0
- tamga_protocol-0.2.0rc1/tamga_netproxy.py +391 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/PKG-INFO +119 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/SOURCES.txt +17 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/dependency_links.txt +1 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/entry_points.txt +2 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/requires.txt +1 -0
- tamga_protocol-0.2.0rc1/tamga_protocol.egg-info/top_level.txt +7 -0
- tamga_protocol-0.2.0rc1/tamga_runner.py +1084 -0
- tamga_protocol-0.2.0rc1/tamga_validator.py +305 -0
- tamga_protocol-0.2.0rc1/tamga_verify_mini.py +95 -0
|
@@ -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.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tamga-protocol
|
|
3
|
+
Version: 0.2.0rc1
|
|
4
|
+
Summary: Self-custodial hash-chained work-receipt ledger for autonomous AI agents (RFC-002/003/007)
|
|
5
|
+
Author: Tamga Protocol
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/goun7/tamga-protocol
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Topic :: Security :: Cryptography
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: PyNaCl>=1.5
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# QUICKSTART — Tamga Protocol in 5 minutes
|
|
19
|
+
|
|
20
|
+
> Self-custodial, hash-chained work-receipt ledger for autonomous AI agents.
|
|
21
|
+
> Every claim below was executed on a clean venv before being written here.
|
|
22
|
+
|
|
23
|
+
## 0. Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install tamga-protocol # Python 3.10+, single dependency: PyNaCl
|
|
27
|
+
tamga --help # command overview (no engine needed)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The 67 MB wasmtime engine is **not** in the wheel. It is downloaded once,
|
|
31
|
+
SHA256-pinned, on your first `tamga run` — verification commands never need it.
|
|
32
|
+
|
|
33
|
+
## 1. Generate an agent seed (printed once, never stored)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
tamga keygen
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{"ok": true, "op": "keygen", "agent_id": "4f83f2ac…", "seed_hex": "c4717ab8…",
|
|
41
|
+
"note": "D3: seed not written to disk; store it safely"}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Keep `seed_hex` for the next step. Losing it means losing the agent identity.
|
|
45
|
+
|
|
46
|
+
## 2. Run a job (fee charged, receipt appended)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
export TAMGA_KS_PASSPHRASE=quickstart-2026 # keystore passphrase (your choice)
|
|
50
|
+
tamga run ./my-pkg --seed <seed_hex>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{"ok": true, "op": "run", "pkg": "my-pkg", "session": 1, "nodes": 3,
|
|
55
|
+
"engine": "wasmtime-v48.0.1", "wall_ms": 115, "fee_sim": 2.279e-06,
|
|
56
|
+
"stdout_sha256": "aa8a2cd1…"}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
No package yet? Copy the demo: `cp -r tests/vectors/tc-net-demo ./my-pkg`
|
|
60
|
+
(from the repo) — it contains `tamga.json` + a tiny WASI-0.3 agent.
|
|
61
|
+
|
|
62
|
+
## 3. Verify the chain (no engine, no trust in the runner)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
tamga ledger-verify ./my-pkg
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{"ok": true, "op": "ledger-verify", "lines": 1,
|
|
70
|
+
"head": "9314bcdf…", "note": "chain tip verified (RFC-003 D7 draft)"}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Anyone with this JSON output can re-verify your chain independently.
|
|
74
|
+
|
|
75
|
+
## 4. Migrate the agent (sealed snapshot travels, key never on disk)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
tamga export ./my-pkg -o snapshot.tsg --seed <seed_hex>
|
|
79
|
+
# on the new host — package dir must exist with the same code (tamga.json + agent.wasm):
|
|
80
|
+
tamga import snapshot.tsg ./my-pkg-restored
|
|
81
|
+
tamga ledger-verify ./my-pkg-restored # chain resumed: lines=1
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{"ok": true, "op": "import", "resumed_session": 1, "memory_nodes": 3,
|
|
86
|
+
"note": "AT-001e: identity from keystore, memory from body — restored"}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 5. If something misbehaves
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
tamga doctor # install health: python / pynacl / wasmtime / verify-mini / bundle
|
|
93
|
+
tamga --version
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 6. Let someone verify you without installing anything
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
tamga verify-mini ./my-pkg/ledger.jsonl # stdlib-only, no engine, no Tamga install
|
|
100
|
+
tamga bundle ./my-pkg -o evidence/ # one-file proof package (JSON + human summary)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The bundle carries the chain records, the manifest re-hash, and per-job
|
|
104
|
+
digests — the counterparty re-derives every claim offline. Full flow:
|
|
105
|
+
[docs/AGENT-GUIDE.md §8b](AGENT-GUIDE.md).
|
|
106
|
+
|
|
107
|
+
## What just happened
|
|
108
|
+
|
|
109
|
+
- The job ran inside a **denied-by-default WASI sandbox** (no filesystem preopens, no network).
|
|
110
|
+
- Its **fee, stdout hash, and memory delta** were appended to a hash-chained ledger.
|
|
111
|
+
- The **agent identity + memory** traveled in one encrypted snapshot you can hold.
|
|
112
|
+
- Verification is **offline and third-party** — `ledger-verify` recomputes the chain.
|
|
113
|
+
|
|
114
|
+
## Next steps
|
|
115
|
+
|
|
116
|
+
- Threat model & architecture: [docs/ARCHITECTURE.md](ARCHITECTURE.md)
|
|
117
|
+
- Ledger spec: [RFC-003](RFC-003-ledger.md) · Runner spec: [RFC-002](RFC-002-runner.md)
|
|
118
|
+
- Full test evidence: [docs/TESTS.md](TESTS.md)
|
|
119
|
+
- Plain-language intro (Türkçe): [docs/PLAIN-TURKISH.md](PLAIN-TURKISH.md)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="docs/assets/banner.svg" width="660" alt="Tamga Protocol — portable identity, encrypted memory, verifiable work receipts"/>
|
|
4
|
+
|
|
5
|
+
[](https://github.com/goun7/tamga-protocol/actions/workflows/ci.yml)
|
|
6
|
+
[](#one-command-regression)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](#roadmap)
|
|
9
|
+
[](docs/REPRODUCE.md) — last full suite run: 2026-09-09
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why does this exist?
|
|
16
|
+
|
|
17
|
+
The agent ecosystem has three layers — and none of them fills the gap between them:
|
|
18
|
+
|
|
19
|
+
| Layer | Who's building it | What's missing |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Memory | Mem0 · Letta · Zep | **Portability** — locked to the vendor, keys on their side |
|
|
22
|
+
| Trust | ERC-8004 (Ethereum) | **State** — the agent dies, its memory evaporates |
|
|
23
|
+
| Payments | x402 | **Proof** — no verifiable evidence that "the work actually happened" |
|
|
24
|
+
|
|
25
|
+
Tamga lives in that gap: **encrypted, portable, tamper-evident agent state.**
|
|
26
|
+
Not a competitor — a complement. See [docs/ERC-8004-MAPPING.md](docs/ERC-8004-MAPPING.md).
|
|
27
|
+
|
|
28
|
+
## 30-second summary
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 1. The agent runs (WASI 0.3 component, default-deny sandbox)
|
|
32
|
+
python3 tamga_runner.py run pkg/ --seed $SEED --input job.json --require-proof
|
|
33
|
+
|
|
34
|
+
# 2. The machine dies — identity+memory+ledger travel in ONE encrypted snapshot
|
|
35
|
+
python3 tamga_runner.py export pkg/ -o snapshot.tsg --seed $SEED
|
|
36
|
+
|
|
37
|
+
# 3. On a new node, the agent RESUMES where it left off
|
|
38
|
+
python3 tamga_runner.py import snapshot.tsg new-pkg/
|
|
39
|
+
|
|
40
|
+
# 4. "This work actually happened" — the hash-chained receipts verify
|
|
41
|
+
python3 tamga_runner.py ledger-verify new-pkg/ # ok: true
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Core guarantees
|
|
45
|
+
|
|
46
|
+
- 🔐 **At-rest privacy, proven for the snapshot** — the agent seed and snapshot body
|
|
47
|
+
never touch disk in plaintext (XChaCha20-Poly1305 + scrypt); the suite greps the
|
|
48
|
+
encrypted snapshot body for plaintext — **0 hits** (node-side `state.json` keeps
|
|
49
|
+
memory text in plaintext by design — confidentiality at rest is the snapshot's job)
|
|
50
|
+
- ⛓️ **Tamper-evident accounting** — hash-chained ledger; truncate/splice forgery → RED
|
|
51
|
+
- 🪪 **Ownership travels with the agent** — node-cosign: the node seals work-receipts
|
|
52
|
+
with its own certificate; a revocation list invalidates the decommissioned node
|
|
53
|
+
- ⌨️ **Input-bound work receipts** — `--input` binds `input_sha256` into the receipt;
|
|
54
|
+
the agent can be asked to stamp its output (`--require-proof`) and the runner
|
|
55
|
+
verifies the stamp before signing the receipt
|
|
56
|
+
- 🔁 **Determinism ground** — same wasm + same input → identical output fingerprint
|
|
57
|
+
(the precondition for stake-backed re-execution)
|
|
58
|
+
- 🚫 **Offline & default-deny** — the runtime has no network, no filesystem, no host env;
|
|
59
|
+
wasmtime v48 on ratified WASI 0.3 components
|
|
60
|
+
|
|
61
|
+
```mermaid
|
|
62
|
+
flowchart LR
|
|
63
|
+
subgraph N1["Node-1 (source host)"]
|
|
64
|
+
AG["agent<br/>(identity + encrypted memory)"] --> R["run<br/>work-receipt (charge)"]
|
|
65
|
+
AG --> L["hash-chained ledger"]
|
|
66
|
+
end
|
|
67
|
+
R -- "snapshot.tsg (XChaCha20 encrypted)" --> I
|
|
68
|
+
L -- "ledger_tip binding" --> I
|
|
69
|
+
subgraph N2["Node-2 (new host)"]
|
|
70
|
+
I["import: identity + memory restore"] --> AG2["agent resumes<br/>where it left off"]
|
|
71
|
+
I --> V["ledger-verify:<br/>broken chain → RED"]
|
|
72
|
+
end
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
New here? → [docs/QUICKSTART.md](docs/QUICKSTART.md) (5-minute setup, `pip install tamga-protocol`).
|
|
76
|
+
|
|
77
|
+
Full technical details: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
78
|
+
|
|
79
|
+
## Honest limits (what v0 does NOT claim)
|
|
80
|
+
|
|
81
|
+
- **In-use privacy is unproven:** while running, the seed lives in host RAM — TEE (Phase 3)
|
|
82
|
+
- **Not a production network:** simnet; all amounts are `*_sim`; this is NOT a token/coin
|
|
83
|
+
- **Scale:** snapshot ≤ 64 MiB (safe envelope); multi-node ledger merging is an open question
|
|
84
|
+
- **Determinism scope is class-defined:** deterministic wasm jobs are replay-proven;
|
|
85
|
+
LLM-class jobs use a different evidence contract (see ARCHITECTURE §Determinism)
|
|
86
|
+
- **Language surface:** core code comments, suite output and docs are English. Preserved
|
|
87
|
+
Turkish by contract or design: the frozen v0.1 JSON field names (`cpu_saat`,
|
|
88
|
+
`ram_gb_sn`, `fee_birebir` — renamed only by a versioned RFC), the example agent's
|
|
89
|
+
proof-line narrative inside compiled .wasm artifacts, and synthetic fixture texts
|
|
90
|
+
(sample memory/session contents)
|
|
91
|
+
|
|
92
|
+
Open findings are tracked in an internal audit ledger (10 adversarial rounds;
|
|
93
|
+
attack simulations). Disclosure process: [SECURITY.md](SECURITY.md).
|
|
94
|
+
|
|
95
|
+
## 30-second demo
|
|
96
|
+
|
|
97
|
+

|
|
98
|
+
|
|
99
|
+
The animated walkthrough: mint identity → do input-bound work on node1 → the
|
|
100
|
+
node "dies" → the agent revives on node2 with its memory intact → the receipt
|
|
101
|
+
ledger verifies. Play it yourself in one command: `bash tools/demo.sh`, or watch
|
|
102
|
+
the raw session: [docs/assets/demo.cast](docs/assets/demo.cast).
|
|
103
|
+
|
|
104
|
+
## Quick start
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/goun7/tamga-protocol && cd tamga-protocol
|
|
108
|
+
python3 -m venv .venv && source .venv/bin/activate # or: pip install --break-system-packages -r requirements.txt
|
|
109
|
+
pip install -r requirements.txt
|
|
110
|
+
bash tests/setup.sh # one-time: installs pinned wasmtime into tools/bin/
|
|
111
|
+
bash tests/run_all.sh # 35/35 controls — ~20 s
|
|
112
|
+
|
|
113
|
+
# your first agent (copy the sample vector as the package — see docs/AGENT-GUIDE §3):
|
|
114
|
+
python3 tamga_validator.py keygen tests/keys/alice
|
|
115
|
+
python3 tamga_validator.py sign <pkg>/tamga.json <pkg>/agent.wasm tests/keys/alice/seed.hex
|
|
116
|
+
python3 tamga_validator.py validate <pkg> # until ACCEPT
|
|
117
|
+
|
|
118
|
+
# run (agent identity key never touches disk — printed to stdout only):
|
|
119
|
+
AGENT_SEED=$(python3 tamga_runner.py keygen | python3 -c 'import sys,json;print(json.load(sys.stdin)["seed_hex"])')
|
|
120
|
+
export TAMGA_KS_PASSPHRASE="..." # your choice
|
|
121
|
+
python3 tamga_runner.py run <pkg> --seed "$AGENT_SEED" --note "first run"
|
|
122
|
+
python3 tamga_runner.py run <pkg> --seed "$AGENT_SEED" --input job.json --require-proof
|
|
123
|
+
python3 tamga_runner.py export <pkg> -o snapshot.tsg --seed "$AGENT_SEED"
|
|
124
|
+
# import requires the target pkg pre-provisioned (tamga.json + agent.wasm): code travels separately
|
|
125
|
+
python3 tamga_runner.py import snapshot.tsg <new-pkg>
|
|
126
|
+
python3 tamga_runner.py ledger-verify <new-pkg>
|
|
127
|
+
python3 tamga_runner.py memory <pkg> --search <query>
|
|
128
|
+
python3 tamga_runner.py memory <pkg> --import-json lessons.json # ADD-only memory bridge
|
|
129
|
+
# bringing memory from another store? multi-format converter (mem0/letta/zep/jsonl):
|
|
130
|
+
python3 tools/memory_import.py --from export.json --format auto -o converted.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## One-command regression
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
bash tests/run_all.sh # 35/35 controls — families below, ~20 s on a laptop
|
|
137
|
+
```
|
|
138
|
+
Control families: snapshot lifecycle + adversarial negatives (AT-001), determinism/replay
|
|
139
|
+
(AT-002), ledger attack vectors (AT-003), input-bound receipts (AT-004), multi-format memory
|
|
140
|
+
import (AT-005), manifest-schema cross-validation (55/55 incl. the v0.2 draft additive contract + spec_version transition matrix), plus tokenomics/economy invariants. Details:
|
|
141
|
+
[docs/TESTS.md](docs/TESTS.md). CI runs the full suite on every push (ubuntu-latest,
|
|
142
|
+
wasmtime v48.0.1).
|
|
143
|
+
|
|
144
|
+
## 30-second live demo
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
bash tools/demo.sh # born → input-bound work → dies → travels → revives → receipt verified
|
|
148
|
+
```
|
|
149
|
+
Recorded session: [docs/assets/demo.cast](docs/assets/demo.cast) (play with `asciinema`) —
|
|
150
|
+
expected flow: [docs/DEMO-SCRIPT.md](docs/DEMO-SCRIPT.md).
|
|
151
|
+
|
|
152
|
+
## Importing your memory
|
|
153
|
+
|
|
154
|
+
Bring existing agent memory in via JSON-lines (`--import-json`): the merge is
|
|
155
|
+
ADD-only and idempotent — re-importing the same source skips what's already there.
|
|
156
|
+
The source store is opened read-only; intermediate data stays in RAM.
|
|
157
|
+
Export adapters for external memory stores are on the Phase-2 roadmap.
|
|
158
|
+
Developer guide: [docs/AGENT-GUIDE.md](docs/AGENT-GUIDE.md).
|
|
159
|
+
|
|
160
|
+
## Documents
|
|
161
|
+
|
|
162
|
+
| Doc | Content |
|
|
163
|
+
|---|---|
|
|
164
|
+
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Technical architecture: formats, chain, cosign, reason codes, limits |
|
|
165
|
+
| [docs/DESIGN-PARTNERS.md](docs/DESIGN-PARTNERS.md) | Design-partner program (v0.1→v0.2): free migration + a seat in the freeze loop |
|
|
166
|
+
| [RFC-008-external-receipt-DRAFT.md](docs/RFC-008-external-receipt-DRAFT.md) | DRAFT (pilot-pending): external-receipt binding schema — x402 and other rails, three open questions the pilot day will close |
|
|
167
|
+
| [RELEASE.md](RELEASE.md) | v0.2.0-rc.1 release notes (declared egress, RFC-007) + v0.1 archive: highlights, verification, honest limits |
|
|
168
|
+
| [PLAIN-TURKISH.md](docs/PLAIN-TURKISH.md) | plain-language explainer (Turkish + short English summary) — no code reading required |
|
|
169
|
+
| [docs/RFC-001-manifest.md](docs/RFC-001-manifest.md) | Package manifest schema contract (v0.1-FINAL, frozen, English translation) |
|
|
170
|
+
| [docs/RFC-002-runner.md](docs/RFC-002-runner.md) | Runner API + snapshot transport contract (v0.1-FINAL, frozen, English translation) |
|
|
171
|
+
| [docs/RFC-003-ledger.md](docs/RFC-003-ledger.md) | Ledger record contract (DRAFT v0.1, English translation) |
|
|
172
|
+
| [docs/RFC-004-context-graph.md](docs/RFC-004-context-graph.md) | ADD-only context-graph contract (DRAFT v0.1, English translation) |
|
|
173
|
+
| [docs/AGENT-GUIDE.md](docs/AGENT-GUIDE.md) | Agent developer guide (mental model → first run → migration) |
|
|
174
|
+
| [docs/TESTS.md](docs/TESTS.md) | Test families + how to run + CI |
|
|
175
|
+
| [docs/AUDIT-GATE.md](docs/AUDIT-GATE.md) | The 8-step gate every change passes |
|
|
176
|
+
| [docs/DEMO-SCRIPT.md](docs/DEMO-SCRIPT.md) | 30-second demo: expected flow |
|
|
177
|
+
| [docs/ERC-8004-MAPPING.md](docs/ERC-8004-MAPPING.md) | ERC-8004 ↔ Tamga mapping (Phase-3 design note) |
|
|
178
|
+
| [specs/manifest-0.1.0.schema.json](specs/manifest-0.1.0.schema.json) | Package manifest JSON Schema |
|
|
179
|
+
| [SECURITY.md](SECURITY.md) | Vulnerability disclosure + reporting forms |
|
|
180
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | How to contribute |
|
|
181
|
+
|
|
182
|
+
> **Language note:** deep design documents (RFC-001…005, the full audit report,
|
|
183
|
+
> tokenomics) are currently canonical in **Turkish**; English translations are in
|
|
184
|
+
> progress and will be published here progressively. Turkish README: [README.tr.md](README.tr.md).
|
|
185
|
+
|
|
186
|
+
## Roadmap
|
|
187
|
+
|
|
188
|
+
- ✅ **Phase 1** — simnet genesis: primitives + acceptance tests + 10 audit rounds
|
|
189
|
+
- 🔄 **Phase 2** — hardening: memory-store adapters, overhead statement, design-partner pilot
|
|
190
|
+
- 🔒 **Phase 3** — network: ERC-8004 registration + real micropayments + TEE pilot *(gated)*
|
|
191
|
+
- 🔒 **Phase 4** — protocol v2: zkVM proof layer, governance *(double-gated)*
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
195
|
+
Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [audit gate](docs/AUDIT-GATE.md):
|
|
196
|
+
a change = tests + evidence. Report vulnerabilities privately via [SECURITY.md](SECURITY.md).
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
[Apache-2.0](LICENSE) — contributors' patents extend to users; anyone filing a patent
|
|
201
|
+
claim loses the license.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# QUICKSTART — Tamga Protocol in 5 minutes
|
|
2
|
+
|
|
3
|
+
> Self-custodial, hash-chained work-receipt ledger for autonomous AI agents.
|
|
4
|
+
> Every claim below was executed on a clean venv before being written here.
|
|
5
|
+
|
|
6
|
+
## 0. Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install tamga-protocol # Python 3.10+, single dependency: PyNaCl
|
|
10
|
+
tamga --help # command overview (no engine needed)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The 67 MB wasmtime engine is **not** in the wheel. It is downloaded once,
|
|
14
|
+
SHA256-pinned, on your first `tamga run` — verification commands never need it.
|
|
15
|
+
|
|
16
|
+
## 1. Generate an agent seed (printed once, never stored)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
tamga keygen
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{"ok": true, "op": "keygen", "agent_id": "4f83f2ac…", "seed_hex": "c4717ab8…",
|
|
24
|
+
"note": "D3: seed not written to disk; store it safely"}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Keep `seed_hex` for the next step. Losing it means losing the agent identity.
|
|
28
|
+
|
|
29
|
+
## 2. Run a job (fee charged, receipt appended)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
export TAMGA_KS_PASSPHRASE=quickstart-2026 # keystore passphrase (your choice)
|
|
33
|
+
tamga run ./my-pkg --seed <seed_hex>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{"ok": true, "op": "run", "pkg": "my-pkg", "session": 1, "nodes": 3,
|
|
38
|
+
"engine": "wasmtime-v48.0.1", "wall_ms": 115, "fee_sim": 2.279e-06,
|
|
39
|
+
"stdout_sha256": "aa8a2cd1…"}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
No package yet? Copy the demo: `cp -r tests/vectors/tc-net-demo ./my-pkg`
|
|
43
|
+
(from the repo) — it contains `tamga.json` + a tiny WASI-0.3 agent.
|
|
44
|
+
|
|
45
|
+
## 3. Verify the chain (no engine, no trust in the runner)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
tamga ledger-verify ./my-pkg
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{"ok": true, "op": "ledger-verify", "lines": 1,
|
|
53
|
+
"head": "9314bcdf…", "note": "chain tip verified (RFC-003 D7 draft)"}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Anyone with this JSON output can re-verify your chain independently.
|
|
57
|
+
|
|
58
|
+
## 4. Migrate the agent (sealed snapshot travels, key never on disk)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
tamga export ./my-pkg -o snapshot.tsg --seed <seed_hex>
|
|
62
|
+
# on the new host — package dir must exist with the same code (tamga.json + agent.wasm):
|
|
63
|
+
tamga import snapshot.tsg ./my-pkg-restored
|
|
64
|
+
tamga ledger-verify ./my-pkg-restored # chain resumed: lines=1
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{"ok": true, "op": "import", "resumed_session": 1, "memory_nodes": 3,
|
|
69
|
+
"note": "AT-001e: identity from keystore, memory from body — restored"}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 5. If something misbehaves
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
tamga doctor # install health: python / pynacl / wasmtime / verify-mini / bundle
|
|
76
|
+
tamga --version
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 6. Let someone verify you without installing anything
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
tamga verify-mini ./my-pkg/ledger.jsonl # stdlib-only, no engine, no Tamga install
|
|
83
|
+
tamga bundle ./my-pkg -o evidence/ # one-file proof package (JSON + human summary)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The bundle carries the chain records, the manifest re-hash, and per-job
|
|
87
|
+
digests — the counterparty re-derives every claim offline. Full flow:
|
|
88
|
+
[docs/AGENT-GUIDE.md §8b](AGENT-GUIDE.md).
|
|
89
|
+
|
|
90
|
+
## What just happened
|
|
91
|
+
|
|
92
|
+
- The job ran inside a **denied-by-default WASI sandbox** (no filesystem preopens, no network).
|
|
93
|
+
- Its **fee, stdout hash, and memory delta** were appended to a hash-chained ledger.
|
|
94
|
+
- The **agent identity + memory** traveled in one encrypted snapshot you can hold.
|
|
95
|
+
- Verification is **offline and third-party** — `ledger-verify` recomputes the chain.
|
|
96
|
+
|
|
97
|
+
## Next steps
|
|
98
|
+
|
|
99
|
+
- Threat model & architecture: [docs/ARCHITECTURE.md](ARCHITECTURE.md)
|
|
100
|
+
- Ledger spec: [RFC-003](RFC-003-ledger.md) · Runner spec: [RFC-002](RFC-002-runner.md)
|
|
101
|
+
- Full test evidence: [docs/TESTS.md](TESTS.md)
|
|
102
|
+
- Plain-language intro (Türkçe): [docs/PLAIN-TURKISH.md](PLAIN-TURKISH.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tamga-protocol"
|
|
7
|
+
version = "0.2.0rc1"
|
|
8
|
+
description = "Self-custodial hash-chained work-receipt ledger for autonomous AI agents (RFC-002/003/007)"
|
|
9
|
+
readme = "docs/QUICKSTART.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Tamga Protocol" }]
|
|
13
|
+
urls = { Homepage = "https://github.com/goun7/tamga-protocol" }
|
|
14
|
+
dependencies = ["PyNaCl>=1.5"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Topic :: Security :: Cryptography",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
tamga = "tamga_bootstrap:main"
|
|
24
|
+
|
|
25
|
+
[tool.setuptools]
|
|
26
|
+
py-modules = ["tamga_runner", "tamga_validator", "tamga_netproxy", "tamga_net_shim", "tamga_bootstrap", "tamga_verify_mini", "tamga_bundle"]
|
|
27
|
+
include-package-data = false
|