ratify-protocol-native 1.0.0a18__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.
- ratify_protocol_native-1.0.0a18/PKG-INFO +124 -0
- ratify_protocol_native-1.0.0a18/README.md +103 -0
- ratify_protocol_native-1.0.0a18/pyproject.toml +32 -0
- ratify_protocol_native-1.0.0a18/python-native/Cargo.lock +674 -0
- ratify_protocol_native-1.0.0a18/python-native/Cargo.toml +20 -0
- ratify_protocol_native-1.0.0a18/python-native/README.md +103 -0
- ratify_protocol_native-1.0.0a18/python-native/src/lib.rs +65 -0
- ratify_protocol_native-1.0.0a18/rust/.gitignore +3 -0
- ratify_protocol_native-1.0.0a18/rust/Cargo.lock +574 -0
- ratify_protocol_native-1.0.0a18/rust/Cargo.toml +53 -0
- ratify_protocol_native-1.0.0a18/rust/README.body.md +161 -0
- ratify_protocol_native-1.0.0a18/rust/README.md +184 -0
- ratify_protocol_native-1.0.0a18/rust/src/canonical.rs +451 -0
- ratify_protocol_native-1.0.0a18/rust/src/challenge_store.rs +210 -0
- ratify_protocol_native-1.0.0a18/rust/src/constraints.rs +341 -0
- ratify_protocol_native-1.0.0a18/rust/src/crypto.rs +834 -0
- ratify_protocol_native-1.0.0a18/rust/src/lib.rs +102 -0
- ratify_protocol_native-1.0.0a18/rust/src/operation_context.rs +122 -0
- ratify_protocol_native-1.0.0a18/rust/src/receipts.rs +366 -0
- ratify_protocol_native-1.0.0a18/rust/src/resource_path.rs +212 -0
- ratify_protocol_native-1.0.0a18/rust/src/scope.rs +353 -0
- ratify_protocol_native-1.0.0a18/rust/src/types.rs +1071 -0
- ratify_protocol_native-1.0.0a18/rust/src/verify.rs +1137 -0
- ratify_protocol_native-1.0.0a18/rust/src/wire.rs +315 -0
- ratify_protocol_native-1.0.0a18/rust/tests/challenge_store.rs +439 -0
- ratify_protocol_native-1.0.0a18/rust/tests/conformance.rs +707 -0
- ratify_protocol_native-1.0.0a18/rust/tests/cross_sdk.rs +249 -0
- ratify_protocol_native-1.0.0a18/rust/tests/levers.rs +517 -0
- ratify_protocol_native-1.0.0a18/rust/tests/operation_context.rs +158 -0
- ratify_protocol_native-1.0.0a18/rust/tests/providers.rs +353 -0
- ratify_protocol_native-1.0.0a18/rust/tests/resource_path.rs +705 -0
- ratify_protocol_native-1.0.0a18/rust/tests/streamed_verify_options.rs +366 -0
- ratify_protocol_native-1.0.0a18/rust/tests/vocabulary.rs +49 -0
- ratify_protocol_native-1.0.0a18/rust/tests/wire_encode.rs +117 -0
- ratify_protocol_native-1.0.0a18/rust/tests/wire_negative.rs +96 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ratify-protocol-native
|
|
3
|
+
Version: 1.0.0a18
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Topic :: Security :: Cryptography
|
|
13
|
+
Summary: Native deterministic key generation for the Ratify Protocol Python SDK
|
|
14
|
+
Author-email: "Identities AI, Inc." <hello@identities.ai>
|
|
15
|
+
License: Apache-2.0
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
18
|
+
Project-URL: Homepage, https://ratifyprotocol.com
|
|
19
|
+
Project-URL: Repository, https://github.com/identities-ai/ratify-protocol
|
|
20
|
+
|
|
21
|
+
# ratify-protocol-native
|
|
22
|
+
|
|
23
|
+
**You almost certainly do not need this package.**
|
|
24
|
+
|
|
25
|
+
Install [`ratify-protocol`](https://pypi.org/project/ratify-protocol/) instead.
|
|
26
|
+
That is the Python SDK: it verifies proofs, issues delegations, signs
|
|
27
|
+
challenges, and stores identities, in pure Python, on every platform.
|
|
28
|
+
|
|
29
|
+
This package is a small optional add-on to that SDK. It exists to provide
|
|
30
|
+
**one function**, and nothing else.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What this package does
|
|
35
|
+
|
|
36
|
+
It provides deterministic key generation: turning two 32-byte seeds into the
|
|
37
|
+
same Ratify identity every time, and the same identity that the Go, Rust,
|
|
38
|
+
TypeScript, and C SDKs derive from those seeds.
|
|
39
|
+
|
|
40
|
+
That is the whole scope. It contains no verification logic, no signing logic,
|
|
41
|
+
and no protocol implementation. Installing it does not change how anything else
|
|
42
|
+
in the Python SDK behaves.
|
|
43
|
+
|
|
44
|
+
## Do you need it?
|
|
45
|
+
|
|
46
|
+
**No, if** you are verifying proofs, issuing delegations, signing challenges, or
|
|
47
|
+
saving an identity to reuse later. All of that works in `ratify-protocol` with
|
|
48
|
+
nothing extra. To persist an identity, store its key bytes and load them back.
|
|
49
|
+
|
|
50
|
+
**Yes, if** you need the *same seeds* to produce the *same identity* in Python
|
|
51
|
+
as in another language. For example: a Go service generates an identity from
|
|
52
|
+
seeds it holds, and a Python process must reconstruct that identity from the
|
|
53
|
+
same seeds.
|
|
54
|
+
|
|
55
|
+
If you are not sure, you do not need it.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
pip install 'ratify-protocol[native]'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Install it through the extra rather than by name. The extra pins the two
|
|
64
|
+
packages to matching versions, which is what keeps them compatible.
|
|
65
|
+
|
|
66
|
+
Once installed, nothing changes in how you write code. The function that
|
|
67
|
+
previously raised now works:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from ratify_protocol import hybrid_keypair_from_seeds, derive_id
|
|
71
|
+
|
|
72
|
+
ed_seed = bytes(range(32))
|
|
73
|
+
ml_seed = bytes((0xA0 + i) & 0xFF for i in range(32))
|
|
74
|
+
public, private = hybrid_keypair_from_seeds(ed_seed, ml_seed)
|
|
75
|
+
|
|
76
|
+
# The same identity every SDK derives from these seeds.
|
|
77
|
+
assert derive_id(public) == "3823136b5a5fc4c755b22704474172c0"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Without this package, that call raises `NotImplementedError` with instructions.
|
|
81
|
+
It never returns a wrong answer.
|
|
82
|
+
|
|
83
|
+
## Why it has to be a separate package
|
|
84
|
+
|
|
85
|
+
`ratify-protocol` is pure Python and ships a single wheel that installs on any
|
|
86
|
+
platform and any supported CPython. Keeping it that way matters for a library
|
|
87
|
+
whose main job is verifying proofs inside other people's applications.
|
|
88
|
+
|
|
89
|
+
Deterministic ML-DSA-65 key generation cannot be done in pure Python here.
|
|
90
|
+
`pqcrypto`, the library the SDK uses for post-quantum signing, calls PQClean's
|
|
91
|
+
`crypto_sign_keypair`, which reads the operating system's random number
|
|
92
|
+
generator and ignores any seed the caller supplies. The pure-Python ML-DSA
|
|
93
|
+
implementations that exist carry explicit warnings against use in cryptographic
|
|
94
|
+
applications, so they are not an option either.
|
|
95
|
+
|
|
96
|
+
So this one operation runs through the Ratify Rust core, compiled into a small
|
|
97
|
+
extension. Because compiled code is platform-specific, it lives here instead of
|
|
98
|
+
in the SDK. If your platform has no wheel for this package, `ratify-protocol`
|
|
99
|
+
still installs and works; you simply do not get this one function.
|
|
100
|
+
|
|
101
|
+
## What is inside
|
|
102
|
+
|
|
103
|
+
A single Rust function exposed to Python through PyO3, calling the same
|
|
104
|
+
`hybrid_keypair_from_seeds` that the Ratify Rust SDK exposes. Signing and
|
|
105
|
+
verification are untouched and continue to use `pqcrypto`.
|
|
106
|
+
|
|
107
|
+
Wheels are built with the `abi3` stable ABI, so one wheel per platform covers
|
|
108
|
+
CPython 3.10 and every later version.
|
|
109
|
+
|
|
110
|
+
## Handling seeds
|
|
111
|
+
|
|
112
|
+
Both seeds are key material. Anyone holding them can reconstruct the identity
|
|
113
|
+
and act as it. Store them with the same protection you would give a private
|
|
114
|
+
key, and generate them from a cryptographically secure source.
|
|
115
|
+
|
|
116
|
+
## Links
|
|
117
|
+
|
|
118
|
+
- The SDK this belongs to: [`ratify-protocol`](https://pypi.org/project/ratify-protocol/)
|
|
119
|
+
- Protocol specification: [SPEC.md](https://github.com/identities-ai/ratify-protocol/blob/main/SPEC.md)
|
|
120
|
+
- SDK contract and the reason this package exists: [docs/SDKS.md](https://github.com/identities-ai/ratify-protocol/blob/main/docs/SDKS.md)
|
|
121
|
+
- Source: [github.com/identities-ai/ratify-protocol](https://github.com/identities-ai/ratify-protocol)
|
|
122
|
+
|
|
123
|
+
Apache-2.0.
|
|
124
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# ratify-protocol-native
|
|
2
|
+
|
|
3
|
+
**You almost certainly do not need this package.**
|
|
4
|
+
|
|
5
|
+
Install [`ratify-protocol`](https://pypi.org/project/ratify-protocol/) instead.
|
|
6
|
+
That is the Python SDK: it verifies proofs, issues delegations, signs
|
|
7
|
+
challenges, and stores identities, in pure Python, on every platform.
|
|
8
|
+
|
|
9
|
+
This package is a small optional add-on to that SDK. It exists to provide
|
|
10
|
+
**one function**, and nothing else.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What this package does
|
|
15
|
+
|
|
16
|
+
It provides deterministic key generation: turning two 32-byte seeds into the
|
|
17
|
+
same Ratify identity every time, and the same identity that the Go, Rust,
|
|
18
|
+
TypeScript, and C SDKs derive from those seeds.
|
|
19
|
+
|
|
20
|
+
That is the whole scope. It contains no verification logic, no signing logic,
|
|
21
|
+
and no protocol implementation. Installing it does not change how anything else
|
|
22
|
+
in the Python SDK behaves.
|
|
23
|
+
|
|
24
|
+
## Do you need it?
|
|
25
|
+
|
|
26
|
+
**No, if** you are verifying proofs, issuing delegations, signing challenges, or
|
|
27
|
+
saving an identity to reuse later. All of that works in `ratify-protocol` with
|
|
28
|
+
nothing extra. To persist an identity, store its key bytes and load them back.
|
|
29
|
+
|
|
30
|
+
**Yes, if** you need the *same seeds* to produce the *same identity* in Python
|
|
31
|
+
as in another language. For example: a Go service generates an identity from
|
|
32
|
+
seeds it holds, and a Python process must reconstruct that identity from the
|
|
33
|
+
same seeds.
|
|
34
|
+
|
|
35
|
+
If you are not sure, you do not need it.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pip install 'ratify-protocol[native]'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Install it through the extra rather than by name. The extra pins the two
|
|
44
|
+
packages to matching versions, which is what keeps them compatible.
|
|
45
|
+
|
|
46
|
+
Once installed, nothing changes in how you write code. The function that
|
|
47
|
+
previously raised now works:
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from ratify_protocol import hybrid_keypair_from_seeds, derive_id
|
|
51
|
+
|
|
52
|
+
ed_seed = bytes(range(32))
|
|
53
|
+
ml_seed = bytes((0xA0 + i) & 0xFF for i in range(32))
|
|
54
|
+
public, private = hybrid_keypair_from_seeds(ed_seed, ml_seed)
|
|
55
|
+
|
|
56
|
+
# The same identity every SDK derives from these seeds.
|
|
57
|
+
assert derive_id(public) == "3823136b5a5fc4c755b22704474172c0"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Without this package, that call raises `NotImplementedError` with instructions.
|
|
61
|
+
It never returns a wrong answer.
|
|
62
|
+
|
|
63
|
+
## Why it has to be a separate package
|
|
64
|
+
|
|
65
|
+
`ratify-protocol` is pure Python and ships a single wheel that installs on any
|
|
66
|
+
platform and any supported CPython. Keeping it that way matters for a library
|
|
67
|
+
whose main job is verifying proofs inside other people's applications.
|
|
68
|
+
|
|
69
|
+
Deterministic ML-DSA-65 key generation cannot be done in pure Python here.
|
|
70
|
+
`pqcrypto`, the library the SDK uses for post-quantum signing, calls PQClean's
|
|
71
|
+
`crypto_sign_keypair`, which reads the operating system's random number
|
|
72
|
+
generator and ignores any seed the caller supplies. The pure-Python ML-DSA
|
|
73
|
+
implementations that exist carry explicit warnings against use in cryptographic
|
|
74
|
+
applications, so they are not an option either.
|
|
75
|
+
|
|
76
|
+
So this one operation runs through the Ratify Rust core, compiled into a small
|
|
77
|
+
extension. Because compiled code is platform-specific, it lives here instead of
|
|
78
|
+
in the SDK. If your platform has no wheel for this package, `ratify-protocol`
|
|
79
|
+
still installs and works; you simply do not get this one function.
|
|
80
|
+
|
|
81
|
+
## What is inside
|
|
82
|
+
|
|
83
|
+
A single Rust function exposed to Python through PyO3, calling the same
|
|
84
|
+
`hybrid_keypair_from_seeds` that the Ratify Rust SDK exposes. Signing and
|
|
85
|
+
verification are untouched and continue to use `pqcrypto`.
|
|
86
|
+
|
|
87
|
+
Wheels are built with the `abi3` stable ABI, so one wheel per platform covers
|
|
88
|
+
CPython 3.10 and every later version.
|
|
89
|
+
|
|
90
|
+
## Handling seeds
|
|
91
|
+
|
|
92
|
+
Both seeds are key material. Anyone holding them can reconstruct the identity
|
|
93
|
+
and act as it. Store them with the same protection you would give a private
|
|
94
|
+
key, and generate them from a cryptographically secure source.
|
|
95
|
+
|
|
96
|
+
## Links
|
|
97
|
+
|
|
98
|
+
- The SDK this belongs to: [`ratify-protocol`](https://pypi.org/project/ratify-protocol/)
|
|
99
|
+
- Protocol specification: [SPEC.md](https://github.com/identities-ai/ratify-protocol/blob/main/SPEC.md)
|
|
100
|
+
- SDK contract and the reason this package exists: [docs/SDKS.md](https://github.com/identities-ai/ratify-protocol/blob/main/docs/SDKS.md)
|
|
101
|
+
- Source: [github.com/identities-ai/ratify-protocol](https://github.com/identities-ai/ratify-protocol)
|
|
102
|
+
|
|
103
|
+
Apache-2.0.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.7,<2"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ratify-protocol-native"
|
|
7
|
+
description = "Native deterministic key generation for the Ratify Protocol Python SDK"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
authors = [{name = "Identities AI, Inc.", email = "hello@identities.ai"}]
|
|
10
|
+
license = {text = "Apache-2.0"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: Apache Software License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Rust",
|
|
21
|
+
"Topic :: Security :: Cryptography",
|
|
22
|
+
]
|
|
23
|
+
dynamic = ["version"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://ratifyprotocol.com"
|
|
27
|
+
Repository = "https://github.com/identities-ai/ratify-protocol"
|
|
28
|
+
|
|
29
|
+
[tool.maturin]
|
|
30
|
+
module-name = "ratify_protocol_native"
|
|
31
|
+
features = ["pyo3/extension-module"]
|
|
32
|
+
manifest-path = "python-native/Cargo.toml"
|