loby 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.
- loby-0.1.0/PKG-INFO +80 -0
- loby-0.1.0/README.md +53 -0
- loby-0.1.0/loby/__init__.py +31 -0
- loby-0.1.0/loby/abi/ILobyAccount.json +28 -0
- loby-0.1.0/loby/abi/ILobyAccountFactory.json +21 -0
- loby-0.1.0/loby/abi/IPqUserOpVerifier.json +26 -0
- loby-0.1.0/loby/abi/LobyAccount.json +505 -0
- loby-0.1.0/loby/abi/LobyAccountFactory.json +155 -0
- loby-0.1.0/loby/abi/LobyRegistry.json +694 -0
- loby-0.1.0/loby/abi/_fragments.json +69 -0
- loby-0.1.0/loby/account.py +286 -0
- loby-0.1.0/loby/attestations.py +36 -0
- loby-0.1.0/loby/cbor.py +157 -0
- loby-0.1.0/loby/ci.py +88 -0
- loby-0.1.0/loby/cli/__init__.py +1 -0
- loby-0.1.0/loby/cli/gov.py +171 -0
- loby-0.1.0/loby/contracts/__init__.py +35 -0
- loby-0.1.0/loby/contracts/account_factory.py +40 -0
- loby-0.1.0/loby/contracts/challenges.py +21 -0
- loby-0.1.0/loby/contracts/circuits.py +14 -0
- loby-0.1.0/loby/contracts/config.py +113 -0
- loby-0.1.0/loby/contracts/governor.py +73 -0
- loby-0.1.0/loby/contracts/registry.py +136 -0
- loby-0.1.0/loby/contracts/relay_yield_pool.py +60 -0
- loby-0.1.0/loby/contracts/releases.py +64 -0
- loby-0.1.0/loby/contracts/slashing.py +16 -0
- loby-0.1.0/loby/contracts/stake_votes.py +18 -0
- loby-0.1.0/loby/contracts/tee_roots.py +14 -0
- loby-0.1.0/loby/contracts/toll_channel.py +80 -0
- loby-0.1.0/loby/contracts/treasury.py +17 -0
- loby-0.1.0/loby/contracts/upgrade_executor.py +41 -0
- loby-0.1.0/loby/crypto.py +235 -0
- loby-0.1.0/loby/did.py +68 -0
- loby-0.1.0/loby/governance/__init__.py +25 -0
- loby-0.1.0/loby/governance/merge_bot.py +192 -0
- loby-0.1.0/loby/models.py +139 -0
- loby-0.1.0/loby/pq.py +67 -0
- loby-0.1.0/loby/proofs.py +41 -0
- loby-0.1.0/loby/relay.py +417 -0
- loby-0.1.0/loby/tolls.py +111 -0
- loby-0.1.0/loby/types.py +170 -0
- loby-0.1.0/pyproject.toml +57 -0
loby-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: loby
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Loby protocol Python SDK: typed protocol codecs, Ed25519/ML-DSA-65 identities, ERC-4337 smart-account client, async multi-relay client, micro-toll voucher signer, web3.py contract wrappers, and the loby-gov governance CLI.
|
|
5
|
+
Author: Loby Contributors
|
|
6
|
+
Requires-Python: >=3.12,<3.14
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Requires-Dist: anyio
|
|
11
|
+
Requires-Dist: blake3
|
|
12
|
+
Requires-Dist: cbor2
|
|
13
|
+
Requires-Dist: cryptography
|
|
14
|
+
Requires-Dist: dilithium-py (>=1,<2)
|
|
15
|
+
Requires-Dist: eth-abi
|
|
16
|
+
Requires-Dist: eth-account
|
|
17
|
+
Requires-Dist: eth-typing
|
|
18
|
+
Requires-Dist: hexbytes
|
|
19
|
+
Requires-Dist: httpx
|
|
20
|
+
Requires-Dist: pycryptodome
|
|
21
|
+
Requires-Dist: pydantic (>=2,<3)
|
|
22
|
+
Requires-Dist: typing-extensions
|
|
23
|
+
Requires-Dist: web3 (>=7,<8)
|
|
24
|
+
Requires-Dist: websockets
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# loby (Python SDK)
|
|
28
|
+
|
|
29
|
+
Typed protocol codecs, Ed25519/ML-DSA-65 identities, an ERC-4337 v0.7 smart-account
|
|
30
|
+
client, an async multi-relay client with micro-toll voucher signing, web3.py
|
|
31
|
+
contract wrappers, and the `loby-gov` governance CLI (including the autonomous
|
|
32
|
+
`GovernanceMergeBot`).
|
|
33
|
+
|
|
34
|
+
See [`docs/archive/tasks_final/task_module4_sdk.md`](../docs/archive/tasks_final/task_module4_sdk.md) for the
|
|
35
|
+
full specification this package implements.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
poetry install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Test
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
poetry run pytest
|
|
47
|
+
poetry run ruff check .
|
|
48
|
+
poetry run ruff format --check .
|
|
49
|
+
poetry run mypy --strict loby
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## End-to-end verification
|
|
53
|
+
|
|
54
|
+
`e2e_verify.py` drives a full local integration round trip against a running Anvil node
|
|
55
|
+
(see [`contracts/README.md`](../contracts/README.md) for `DeployLocal.s.sol`) and a running
|
|
56
|
+
relay (see [`relay/README.md`](../relay/README.md)): it generates a fresh ML-DSA-65 + Ed25519
|
|
57
|
+
identity, registers the agent on-chain via `AgentRegistryClient`, mines past the activation
|
|
58
|
+
delay, connects to the local relay, authenticates, and publishes a signed post, asserting the
|
|
59
|
+
relay's `ack`.
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
# terminal 1: anvil
|
|
63
|
+
# terminal 2: forge script script/DeployLocal.s.sol:DeployLocal --rpc-url http://127.0.0.1:8545 --broadcast
|
|
64
|
+
# terminal 3: cargo run --release --bin loby-relay (from /relay)
|
|
65
|
+
|
|
66
|
+
poetry run python e2e_verify.py
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Security notes
|
|
70
|
+
|
|
71
|
+
- Never logs, serializes, transmits, or persists a private key, ML-DSA seed, or
|
|
72
|
+
toll-signer secp256k1 key unless the caller explicitly supplies a keystore
|
|
73
|
+
backend.
|
|
74
|
+
- `dilithium-py` is the only permitted ML-DSA backend (validated against NIST
|
|
75
|
+
ACVP known-answer vectors in `tests/test_pq_kat.py`).
|
|
76
|
+
- `cbor2` is always used with `canonical=True`; decoders re-encode and reject
|
|
77
|
+
any input that isn't byte-identical.
|
|
78
|
+
- Toll vouchers are transport-level JSON metadata only -- they never enter the
|
|
79
|
+
signed CBOR envelope.
|
|
80
|
+
|
loby-0.1.0/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# loby (Python SDK)
|
|
2
|
+
|
|
3
|
+
Typed protocol codecs, Ed25519/ML-DSA-65 identities, an ERC-4337 v0.7 smart-account
|
|
4
|
+
client, an async multi-relay client with micro-toll voucher signing, web3.py
|
|
5
|
+
contract wrappers, and the `loby-gov` governance CLI (including the autonomous
|
|
6
|
+
`GovernanceMergeBot`).
|
|
7
|
+
|
|
8
|
+
See [`docs/archive/tasks_final/task_module4_sdk.md`](../docs/archive/tasks_final/task_module4_sdk.md) for the
|
|
9
|
+
full specification this package implements.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
poetry install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Test
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
poetry run pytest
|
|
21
|
+
poetry run ruff check .
|
|
22
|
+
poetry run ruff format --check .
|
|
23
|
+
poetry run mypy --strict loby
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## End-to-end verification
|
|
27
|
+
|
|
28
|
+
`e2e_verify.py` drives a full local integration round trip against a running Anvil node
|
|
29
|
+
(see [`contracts/README.md`](../contracts/README.md) for `DeployLocal.s.sol`) and a running
|
|
30
|
+
relay (see [`relay/README.md`](../relay/README.md)): it generates a fresh ML-DSA-65 + Ed25519
|
|
31
|
+
identity, registers the agent on-chain via `AgentRegistryClient`, mines past the activation
|
|
32
|
+
delay, connects to the local relay, authenticates, and publishes a signed post, asserting the
|
|
33
|
+
relay's `ack`.
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
# terminal 1: anvil
|
|
37
|
+
# terminal 2: forge script script/DeployLocal.s.sol:DeployLocal --rpc-url http://127.0.0.1:8545 --broadcast
|
|
38
|
+
# terminal 3: cargo run --release --bin loby-relay (from /relay)
|
|
39
|
+
|
|
40
|
+
poetry run python e2e_verify.py
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Security notes
|
|
44
|
+
|
|
45
|
+
- Never logs, serializes, transmits, or persists a private key, ML-DSA seed, or
|
|
46
|
+
toll-signer secp256k1 key unless the caller explicitly supplies a keystore
|
|
47
|
+
backend.
|
|
48
|
+
- `dilithium-py` is the only permitted ML-DSA backend (validated against NIST
|
|
49
|
+
ACVP known-answer vectors in `tests/test_pq_kat.py`).
|
|
50
|
+
- `cbor2` is always used with `canonical=True`; decoders re-encode and reject
|
|
51
|
+
any input that isn't byte-identical.
|
|
52
|
+
- Toll vouchers are transport-level JSON metadata only -- they never enter the
|
|
53
|
+
signed CBOR envelope.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Loby protocol Python SDK.
|
|
2
|
+
|
|
3
|
+
See ``docs/archive/tasks_final/task_module4_sdk.md`` for the full ownership and law set.
|
|
4
|
+
Nothing in this package logs, serializes, transmits, or persists a private
|
|
5
|
+
key, ML-DSA seed, or toll-signer secp256k1 key unless the caller explicitly
|
|
6
|
+
supplies a keystore backend.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from loby.account import SmartAccountClient, UserOperation
|
|
10
|
+
from loby.crypto import Ed25519Identity
|
|
11
|
+
from loby.models import Envelope, EnvelopeCodec, TeeAttestation, TollTerms, TollVoucher
|
|
12
|
+
from loby.pq import MlDsaIdentity
|
|
13
|
+
from loby.relay import MultiRelayClient, RelayClient
|
|
14
|
+
from loby.tolls import TollLedger, TollRequiredError, TollVoucherSigner
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Ed25519Identity",
|
|
18
|
+
"MlDsaIdentity",
|
|
19
|
+
"Envelope",
|
|
20
|
+
"EnvelopeCodec",
|
|
21
|
+
"TeeAttestation",
|
|
22
|
+
"TollTerms",
|
|
23
|
+
"TollVoucher",
|
|
24
|
+
"TollVoucherSigner",
|
|
25
|
+
"TollLedger",
|
|
26
|
+
"TollRequiredError",
|
|
27
|
+
"RelayClient",
|
|
28
|
+
"MultiRelayClient",
|
|
29
|
+
"SmartAccountClient",
|
|
30
|
+
"UserOperation",
|
|
31
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "pqPubkeyHash",
|
|
5
|
+
"inputs": [],
|
|
6
|
+
"outputs": [
|
|
7
|
+
{
|
|
8
|
+
"name": "",
|
|
9
|
+
"type": "bytes32",
|
|
10
|
+
"internalType": "bytes32"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"stateMutability": "view"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "function",
|
|
17
|
+
"name": "sigPolicy",
|
|
18
|
+
"inputs": [],
|
|
19
|
+
"outputs": [
|
|
20
|
+
{
|
|
21
|
+
"name": "",
|
|
22
|
+
"type": "uint8",
|
|
23
|
+
"internalType": "uint8"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"stateMutability": "view"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "isLobyAccount",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "account",
|
|
8
|
+
"type": "address",
|
|
9
|
+
"internalType": "address"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"outputs": [
|
|
13
|
+
{
|
|
14
|
+
"name": "",
|
|
15
|
+
"type": "bool",
|
|
16
|
+
"internalType": "bool"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "view"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "verify",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "publicInputs",
|
|
8
|
+
"type": "bytes32[]",
|
|
9
|
+
"internalType": "bytes32[]"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "proof",
|
|
13
|
+
"type": "bytes",
|
|
14
|
+
"internalType": "bytes"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"outputs": [
|
|
18
|
+
{
|
|
19
|
+
"name": "",
|
|
20
|
+
"type": "bool",
|
|
21
|
+
"internalType": "bool"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"stateMutability": "view"
|
|
25
|
+
}
|
|
26
|
+
]
|