xproof 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.
xproof-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 xProof
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.
xproof-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,228 @@
1
+ Metadata-Version: 2.4
2
+ Name: xproof
3
+ Version: 0.1.0
4
+ Summary: Python SDK for xProof — blockchain-anchored proof-of-existence for AI agents on MultiversX
5
+ Author-email: xProof <contact@xproof.app>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://xproof.app
8
+ Project-URL: Repository, https://github.com/jasonxkensei/xproof
9
+ Project-URL: Documentation, https://xproof.app/docs
10
+ Project-URL: Issues, https://github.com/jasonxkensei/xproof/issues
11
+ Project-URL: Changelog, https://github.com/jasonxkensei/xproof/releases
12
+ Keywords: blockchain,multiversx,proof-of-existence,certification,sha256,ai-agents,accountability,audit-trail,web3
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Security :: Cryptography
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: requests>=2.25.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: responses>=0.20.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # xProof Python SDK
36
+
37
+ Python SDK for [xProof](https://xproof.app) — blockchain-anchored proof-of-existence for AI agents on MultiversX.
38
+
39
+ Certify agent actions, verify proofs, and build accountability into any AI workflow.
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ pip install xproof
45
+ ```
46
+
47
+ ## Quick Start
48
+
49
+ ### Zero-friction onboarding (no wallet, no payment)
50
+
51
+ ```python
52
+ from xproof import XProofClient
53
+
54
+ # Register and get 10 free certifications instantly
55
+ client = XProofClient.register("my-research-agent")
56
+ print(client.registration.trial.remaining) # 10
57
+
58
+ # Certify an agent action
59
+ cert = client.certify_hash(
60
+ file_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
61
+ file_name="analysis-output.json",
62
+ author="my-research-agent",
63
+ )
64
+ print(cert.id) # proof UUID
65
+ print(cert.transaction_url) # MultiversX explorer link
66
+ ```
67
+
68
+ ### With an existing API key
69
+
70
+ ```python
71
+ from xproof import XProofClient
72
+
73
+ client = XProofClient(api_key="pm_your_api_key")
74
+
75
+ # Certify a local file (auto-hashes with SHA-256)
76
+ cert = client.certify("path/to/report.pdf", author="Alice")
77
+ print(cert.id)
78
+ print(cert.transaction_url)
79
+
80
+ # Certify with a pre-computed hash
81
+ cert = client.certify_hash(
82
+ file_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
83
+ file_name="report.pdf",
84
+ author="Alice",
85
+ )
86
+
87
+ # Verify a proof by ID (no auth required)
88
+ proof = client.verify("certification-uuid")
89
+ print(proof.file_name, proof.blockchain_status)
90
+
91
+ # Verify by file hash (no auth required)
92
+ proof = client.verify_hash("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
93
+
94
+ # Get current pricing (no auth required)
95
+ pricing = client.get_pricing()
96
+ print(pricing.price_usd)
97
+ ```
98
+
99
+ ## 4W Framework (WHO / WHAT / WHEN / WHY)
100
+
101
+ xProof certifications support the 4W accountability framework via optional
102
+ keyword arguments:
103
+
104
+ ```python
105
+ from xproof import XProofClient, hash_bytes
106
+
107
+ client = XProofClient(api_key="pm_your_key")
108
+
109
+ action_data = b'{"action": "generate_report", "model": "gpt-4"}'
110
+ action_hash = hash_bytes(action_data)
111
+
112
+ cert = client.certify_hash(
113
+ file_hash=action_hash,
114
+ file_name="agent-action.json",
115
+ author="research-agent",
116
+ who="erd1abc...or-agent-id",
117
+ what=action_hash,
118
+ when="2026-03-20T12:00:00Z",
119
+ why=hash_bytes(b"Summarize Q1 earnings report"),
120
+ metadata={"model": "gpt-4", "session_id": "sess-123"},
121
+ )
122
+ ```
123
+
124
+ ## Batch Certification
125
+
126
+ Certify up to 50 files in a single API call:
127
+
128
+ ```python
129
+ results = client.batch_certify([
130
+ {"file_hash": "abc123...", "file_name": "file1.pdf", "author": "my-agent"},
131
+ {"file_hash": "def456...", "file_name": "file2.pdf"},
132
+ ])
133
+
134
+ print(results.summary.total) # 2
135
+ print(results.summary.certified) # 2
136
+ print(results.summary.failed) # 0
137
+
138
+ for cert in results.results:
139
+ print(cert.file_name, cert.id)
140
+ ```
141
+
142
+ Or certify local files (auto-hashed):
143
+
144
+ ```python
145
+ results = client.batch_certify([
146
+ {"path": "file1.pdf", "author": "Alice"},
147
+ {"path": "file2.pdf", "author": "Bob"},
148
+ ])
149
+ ```
150
+
151
+ ## File Hashing Utilities
152
+
153
+ ```python
154
+ from xproof import hash_file, hash_bytes
155
+
156
+ # Hash a file
157
+ sha256_hex = hash_file("path/to/file.pdf")
158
+ print(sha256_hex) # 64-character hex string
159
+
160
+ # Hash raw bytes
161
+ sha256_hex = hash_bytes(b"hello world")
162
+ ```
163
+
164
+ ## Error Handling
165
+
166
+ ```python
167
+ from xproof import XProofClient, AuthenticationError, NotFoundError, ConflictError
168
+
169
+ client = XProofClient(api_key="pm_your_api_key")
170
+
171
+ try:
172
+ cert = client.certify("file.pdf", author="Alice")
173
+ except AuthenticationError:
174
+ print("Invalid API key")
175
+ except ConflictError as e:
176
+ print(f"Already certified: {e.certification_id}")
177
+ except NotFoundError:
178
+ print("Resource not found")
179
+ ```
180
+
181
+ ## API Reference
182
+
183
+ | Method | Description |
184
+ |---|---|
185
+ | `XProofClient.register(agent_name)` | Register a new agent, get 10 free certs |
186
+ | `client.certify(path, author)` | Certify a file (auto-hashes locally) |
187
+ | `client.certify_hash(file_hash, file_name, author)` | Certify with a pre-computed hash |
188
+ | `client.batch_certify(files)` | Batch certify up to 50 files |
189
+ | `client.verify(proof_id)` | Retrieve a proof by ID |
190
+ | `client.verify_hash(file_hash)` | Look up a proof by SHA-256 hash |
191
+ | `client.get_pricing()` | Get current pricing info |
192
+ | `hash_file(path)` | Compute SHA-256 hex digest of a file |
193
+ | `hash_bytes(data)` | Compute SHA-256 hex digest of bytes |
194
+
195
+ ## Models
196
+
197
+ - **`Certification`** — `id`, `file_name`, `file_hash`, `transaction_hash`, `transaction_url`, `created_at`, `author_name`, `blockchain_status`
198
+ - **`BatchResult`** — `results` (list of `Certification`), `summary` (`total`, `certified`, `failed`)
199
+ - **`RegistrationResult`** — `api_key`, `agent_name`, `trial` (`quota`, `used`, `remaining`), `endpoints`
200
+ - **`PricingInfo`** — `protocol`, `version`, `price_usd`, `tiers`, `payment_methods`
201
+
202
+ ## Exceptions
203
+
204
+ | Exception | HTTP Status | Description |
205
+ |---|---|---|
206
+ | `XProofError` | any | Base exception |
207
+ | `AuthenticationError` | 401/403 | Invalid or missing API key |
208
+ | `ValidationError` | 400 | Invalid request data |
209
+ | `NotFoundError` | 404 | Resource not found |
210
+ | `ConflictError` | 409 | File already certified |
211
+ | `RateLimitError` | 429 | Rate limit exceeded |
212
+ | `ServerError` | 5xx | Server error |
213
+
214
+ ## Requirements
215
+
216
+ - Python 3.8+
217
+ - `requests >= 2.25.0`
218
+
219
+ ## Links
220
+
221
+ - [xProof Web App](https://xproof.app)
222
+ - [API Documentation](https://xproof.app/docs)
223
+ - [GitHub](https://github.com/jasonxkensei/xproof)
224
+ - [Agent Proof Standard](https://github.com/jasonxkensei/xproof/blob/main/AGENT_PROOF_STANDARD.md)
225
+
226
+ ## License
227
+
228
+ MIT
xproof-0.1.0/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # xProof Python SDK
2
+
3
+ Python SDK for [xProof](https://xproof.app) — blockchain-anchored proof-of-existence for AI agents on MultiversX.
4
+
5
+ Certify agent actions, verify proofs, and build accountability into any AI workflow.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install xproof
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ### Zero-friction onboarding (no wallet, no payment)
16
+
17
+ ```python
18
+ from xproof import XProofClient
19
+
20
+ # Register and get 10 free certifications instantly
21
+ client = XProofClient.register("my-research-agent")
22
+ print(client.registration.trial.remaining) # 10
23
+
24
+ # Certify an agent action
25
+ cert = client.certify_hash(
26
+ file_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
27
+ file_name="analysis-output.json",
28
+ author="my-research-agent",
29
+ )
30
+ print(cert.id) # proof UUID
31
+ print(cert.transaction_url) # MultiversX explorer link
32
+ ```
33
+
34
+ ### With an existing API key
35
+
36
+ ```python
37
+ from xproof import XProofClient
38
+
39
+ client = XProofClient(api_key="pm_your_api_key")
40
+
41
+ # Certify a local file (auto-hashes with SHA-256)
42
+ cert = client.certify("path/to/report.pdf", author="Alice")
43
+ print(cert.id)
44
+ print(cert.transaction_url)
45
+
46
+ # Certify with a pre-computed hash
47
+ cert = client.certify_hash(
48
+ file_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
49
+ file_name="report.pdf",
50
+ author="Alice",
51
+ )
52
+
53
+ # Verify a proof by ID (no auth required)
54
+ proof = client.verify("certification-uuid")
55
+ print(proof.file_name, proof.blockchain_status)
56
+
57
+ # Verify by file hash (no auth required)
58
+ proof = client.verify_hash("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
59
+
60
+ # Get current pricing (no auth required)
61
+ pricing = client.get_pricing()
62
+ print(pricing.price_usd)
63
+ ```
64
+
65
+ ## 4W Framework (WHO / WHAT / WHEN / WHY)
66
+
67
+ xProof certifications support the 4W accountability framework via optional
68
+ keyword arguments:
69
+
70
+ ```python
71
+ from xproof import XProofClient, hash_bytes
72
+
73
+ client = XProofClient(api_key="pm_your_key")
74
+
75
+ action_data = b'{"action": "generate_report", "model": "gpt-4"}'
76
+ action_hash = hash_bytes(action_data)
77
+
78
+ cert = client.certify_hash(
79
+ file_hash=action_hash,
80
+ file_name="agent-action.json",
81
+ author="research-agent",
82
+ who="erd1abc...or-agent-id",
83
+ what=action_hash,
84
+ when="2026-03-20T12:00:00Z",
85
+ why=hash_bytes(b"Summarize Q1 earnings report"),
86
+ metadata={"model": "gpt-4", "session_id": "sess-123"},
87
+ )
88
+ ```
89
+
90
+ ## Batch Certification
91
+
92
+ Certify up to 50 files in a single API call:
93
+
94
+ ```python
95
+ results = client.batch_certify([
96
+ {"file_hash": "abc123...", "file_name": "file1.pdf", "author": "my-agent"},
97
+ {"file_hash": "def456...", "file_name": "file2.pdf"},
98
+ ])
99
+
100
+ print(results.summary.total) # 2
101
+ print(results.summary.certified) # 2
102
+ print(results.summary.failed) # 0
103
+
104
+ for cert in results.results:
105
+ print(cert.file_name, cert.id)
106
+ ```
107
+
108
+ Or certify local files (auto-hashed):
109
+
110
+ ```python
111
+ results = client.batch_certify([
112
+ {"path": "file1.pdf", "author": "Alice"},
113
+ {"path": "file2.pdf", "author": "Bob"},
114
+ ])
115
+ ```
116
+
117
+ ## File Hashing Utilities
118
+
119
+ ```python
120
+ from xproof import hash_file, hash_bytes
121
+
122
+ # Hash a file
123
+ sha256_hex = hash_file("path/to/file.pdf")
124
+ print(sha256_hex) # 64-character hex string
125
+
126
+ # Hash raw bytes
127
+ sha256_hex = hash_bytes(b"hello world")
128
+ ```
129
+
130
+ ## Error Handling
131
+
132
+ ```python
133
+ from xproof import XProofClient, AuthenticationError, NotFoundError, ConflictError
134
+
135
+ client = XProofClient(api_key="pm_your_api_key")
136
+
137
+ try:
138
+ cert = client.certify("file.pdf", author="Alice")
139
+ except AuthenticationError:
140
+ print("Invalid API key")
141
+ except ConflictError as e:
142
+ print(f"Already certified: {e.certification_id}")
143
+ except NotFoundError:
144
+ print("Resource not found")
145
+ ```
146
+
147
+ ## API Reference
148
+
149
+ | Method | Description |
150
+ |---|---|
151
+ | `XProofClient.register(agent_name)` | Register a new agent, get 10 free certs |
152
+ | `client.certify(path, author)` | Certify a file (auto-hashes locally) |
153
+ | `client.certify_hash(file_hash, file_name, author)` | Certify with a pre-computed hash |
154
+ | `client.batch_certify(files)` | Batch certify up to 50 files |
155
+ | `client.verify(proof_id)` | Retrieve a proof by ID |
156
+ | `client.verify_hash(file_hash)` | Look up a proof by SHA-256 hash |
157
+ | `client.get_pricing()` | Get current pricing info |
158
+ | `hash_file(path)` | Compute SHA-256 hex digest of a file |
159
+ | `hash_bytes(data)` | Compute SHA-256 hex digest of bytes |
160
+
161
+ ## Models
162
+
163
+ - **`Certification`** — `id`, `file_name`, `file_hash`, `transaction_hash`, `transaction_url`, `created_at`, `author_name`, `blockchain_status`
164
+ - **`BatchResult`** — `results` (list of `Certification`), `summary` (`total`, `certified`, `failed`)
165
+ - **`RegistrationResult`** — `api_key`, `agent_name`, `trial` (`quota`, `used`, `remaining`), `endpoints`
166
+ - **`PricingInfo`** — `protocol`, `version`, `price_usd`, `tiers`, `payment_methods`
167
+
168
+ ## Exceptions
169
+
170
+ | Exception | HTTP Status | Description |
171
+ |---|---|---|
172
+ | `XProofError` | any | Base exception |
173
+ | `AuthenticationError` | 401/403 | Invalid or missing API key |
174
+ | `ValidationError` | 400 | Invalid request data |
175
+ | `NotFoundError` | 404 | Resource not found |
176
+ | `ConflictError` | 409 | File already certified |
177
+ | `RateLimitError` | 429 | Rate limit exceeded |
178
+ | `ServerError` | 5xx | Server error |
179
+
180
+ ## Requirements
181
+
182
+ - Python 3.8+
183
+ - `requests >= 2.25.0`
184
+
185
+ ## Links
186
+
187
+ - [xProof Web App](https://xproof.app)
188
+ - [API Documentation](https://xproof.app/docs)
189
+ - [GitHub](https://github.com/jasonxkensei/xproof)
190
+ - [Agent Proof Standard](https://github.com/jasonxkensei/xproof/blob/main/AGENT_PROOF_STANDARD.md)
191
+
192
+ ## License
193
+
194
+ MIT
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "xproof"
7
+ version = "0.1.0"
8
+ description = "Python SDK for xProof — blockchain-anchored proof-of-existence for AI agents on MultiversX"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.8"
12
+ authors = [
13
+ {name = "xProof", email = "contact@xproof.app"},
14
+ ]
15
+ keywords = [
16
+ "blockchain", "multiversx", "proof-of-existence", "certification",
17
+ "sha256", "ai-agents", "accountability", "audit-trail", "web3",
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Intended Audience :: Developers",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.8",
25
+ "Programming Language :: Python :: 3.9",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: Security :: Cryptography",
31
+ "Topic :: Software Development :: Libraries :: Python Modules",
32
+ "Typing :: Typed",
33
+ ]
34
+ dependencies = [
35
+ "requests>=2.25.0",
36
+ ]
37
+
38
+ [project.optional-dependencies]
39
+ dev = [
40
+ "pytest>=7.0",
41
+ "responses>=0.20.0",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://xproof.app"
46
+ Repository = "https://github.com/jasonxkensei/xproof"
47
+ Documentation = "https://xproof.app/docs"
48
+ Issues = "https://github.com/jasonxkensei/xproof/issues"
49
+ Changelog = "https://github.com/jasonxkensei/xproof/releases"
50
+
51
+ [tool.setuptools.packages.find]
52
+ include = ["xproof*"]
53
+
54
+ [tool.setuptools.package-data]
55
+ xproof = ["py.typed"]
56
+
57
+ [tool.pytest.ini_options]
58
+ markers = [
59
+ "integration: marks tests that hit the live xProof API (deselect with '-m \"not integration\"')",
60
+ ]
xproof-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+