-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
243 lines (211 loc) · 7.88 KB
/
Cargo.toml
File metadata and controls
243 lines (211 loc) · 7.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
[package]
name = "bitsage-node"
version = "0.1.0"
edition = "2021"
authors = ["Ciro Labs <contact@bitsage.network>"]
license = "MIT"
repository = "https://github.com/Bitsage-Network/rust-node"
homepage = "https://bitsage.network"
description = "Bitsage Network Worker and Coordinator Node"
keywords = ["starknet", "ai", "depin", "compute", "blockchain"]
categories = ["cryptography", "network-programming", "mathematics"]
rust-version = "1.70"
[dependencies]
# ===== Core Dependencies =====
tokio = { version = "1.35", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
thiserror = "1.0"
uuid = { version = "1.6", features = ["v4", "serde"] }
clap = { version = "4.4", features = ["derive", "env"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
config = "0.13"
# ===== Async & Networking =====
reqwest = { version = "0.11", features = ["json"] }
axum = { version = "0.7", features = ["ws"] }
tower = { version = "0.4", features = ["util"] }
tower-http = { version = "0.5", features = ["cors", "trace"] }
tokio-stream = "0.1"
async-stream = "0.3"
url = "2.5"
# ===== Cryptography =====
rand = "0.8"
getrandom = "0.2" # Secure OS randomness for cryptographic operations
sha2 = "0.10"
sha3 = "0.10"
blake2 = "0.10"
p256 = { version = "0.13", features = ["ecdsa", "sha256"] } # ECDSA P-256 for TEE attestation
# ===== Obelysk / Stwo ZK Proving =====
# Note: Stwo is StarkWare's next-gen prover using Circle STARKs over Mersenne-31
# VENDORED: Using local copy in ../libs/stwo to apply patches for latest nightly compatibility
# The gpu feature provides kernel source, cuda-runtime enables actual CUDA execution
stwo-prover = { path = "../libs/stwo/crates/stwo", package = "stwo", features = ["prover", "parallel"] }
stwo-constraint-framework = { path = "../libs/stwo/crates/constraint-framework", features = ["prover", "parallel"] }
stwo-examples = { path = "../libs/stwo/crates/examples", features = ["parallel"] }
# ML inference proving via STWO Circle STARKs
stwo-ml = { path = "../libs/stwo-ml", optional = true }
# GPU features activated via: cargo build --features cuda
itertools = "0.12" # Used for polynomial operations and by Stwo
num-traits = "0.2" # Numerical traits
# ===== GPU Acceleration (Optional) =====
# CUDA support for 50-100x speedup on proof generation
cudarc = { version = "0.11", optional = true, features = ["driver", "nvrtc"] }
half = { version = "2.3", optional = true } # f16 support for GPU
nvml-wrapper = { version = "0.10", optional = true } # NVIDIA Management Library for GPU metrics
# ... (rest of file)
# ===== Database =====
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid", "rust_decimal"] }
rust_decimal = { version = "1.33", features = ["serde"] }
rocksdb = "0.22" # Embedded key-value store for consensus persistence
# ===== Caching =====
redis = { version = "0.25", features = ["tokio-comp", "connection-manager"], optional = true }
# ===== Starknet =====
starknet = "0.7"
starknet-accounts = "0.7"
starknet-providers = "0.7"
starknet-contract = "0.7"
starknet-core = "0.7"
starknet-crypto = "0.6"
starknet-curve = "0.4" # For EC point operations (ProjectivePoint, GENERATOR)
starknet-ff = { version = "0.3.7", default-features = false, features = ["serde"] }
# ===== Utilities =====
chrono = { version = "=0.4.34", features = ["serde"] }
futures = "0.3"
parking_lot = "0.12"
dashmap = "5.5"
once_cell = "1.19"
lazy_static = "1.4"
sys-info = "0.9" # System information (memory, CPU) for health checks
dirs = "5.0" # Home directory detection for config paths
num_cpus = "1.16" # CPU core detection
# ===== Monitoring & Metrics =====
prometheus = "0.13" # Prometheus metrics collection
# ===== Job Processing =====
rayon = "1.8"
crossbeam = "0.8"
# ===== P2P Networking =====
libp2p = { version = "0.53", features = [
"tokio",
"tcp",
"websocket",
"dns",
"quic",
"noise",
"yamux",
"gossipsub",
"kad",
"request-response",
"json",
"identify",
"ping",
"mdns",
"floodsub",
"macros",
"serde"
] }
multiaddr = "0.18"
libp2p-identity = "0.1"
void = "1.0"
async-trait = "0.1"
bincode = "1.3"
md5 = "0.8.0"
toml = "0.9.2"
rdkafka = "0.37.0"
# ===== Docker Integration (Optional) =====
# bollard = "0.15"
# ===== DataFusion (Data Plane) =====
datafusion = "35.0.0"
datafusion-proto = "35.0.0"
object_store = { version = "0.9.0", features = ["aws"] }
parquet = "50.0.0"
# ===== Security (TEE/Crypto) =====
aes-gcm = "0.10.3"
aes = "0.8" # AES-128-CTR for keystore decryption
ctr = "0.9" # CTR mode for AES
scrypt = "0.11" # scrypt KDF for keystore decryption
hmac = "0.12" # HMAC for keystore MAC verification
chacha20poly1305 = "0.10" # ChaCha20-Poly1305 AEAD for AE hints (fast decryption)
rsa = "0.9.6"
ed25519-dalek = "2.1.1"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
hex = "0.4.3"
jsonwebtoken = "9.2" # JWT authentication
bcrypt = "0.15" # Password hashing
# ===== Fully Homomorphic Encryption (FHE) =====
# Zama's tfhe-rs for computing on encrypted data without decryption
# Enables confidential AI inference where data remains encrypted end-to-end
tfhe = { version = "0.8", features = ["boolean", "shortint", "integer"], optional = true }
# sha2 = "0.10.8" # Removed duplicate
# uuid = { version = "1.6", features = ["v4", "serde"] } # Removed duplicate
# ===== TLS/HTTPS Support =====
rustls = "0.22" # Modern TLS implementation
tokio-rustls = "0.25" # Async TLS for Tokio
rustls-pemfile = "2.0" # PEM file parsing for certificates
rcgen = "0.12" # Certificate generation for development/testing
x509-parser = "0.16" # X.509 certificate parsing and validation
time = { version = "0.3", features = ["formatting", "macros"] } # Time operations for certificates
# ===== Starknet On-Chain Verification =====
num-bigint = "0.4" # For felt252 serialization
# ===== Proof Compression (30-50% calldata savings) =====
lz4_flex = "0.11" # Fast LZ4 compression
zstd = "0.13" # Zstandard compression (best ratio)
snap = "1.1" # Snappy compression
blake3 = "1.5" # Fast hashing for checksums
crypto-bigint = { version = "0.5.5", features = ["alloc"] }
[dev-dependencies]
tokio-test = "0.4"
criterion = { version = "0.5", features = ["html_reports"] }
tempfile = "3.8" # Temporary directories for testing persistence
[[bench]]
name = "ec_operations"
harness = false
[features]
default = ["gpu-metrics"]
# GPU acceleration with CUDA (requires NVIDIA GPU)
# Usage: cargo build --features cuda
cuda = ["cudarc", "half", "stwo-prover/gpu", "stwo-prover/cuda-runtime", "stwo-constraint-framework/gpu", "stwo-constraint-framework/cuda-runtime"]
# GPU metrics monitoring with NVML (requires NVIDIA GPU)
gpu-metrics = ["nvml-wrapper"]
# GPU acceleration with ROCm (future, for AMD GPUs)
rocm = []
# Feature flag for tests with outdated APIs (temporarily disabled)
broken_tests = []
# TEE (Trusted Execution Environment) support for secure enclaves
tee = []
# Redis caching for dashboard metrics
redis-cache = ["redis"]
# Fully Homomorphic Encryption for encrypted compute
# Usage: cargo build --features fhe
fhe = ["tfhe"]
# ML inference proving with stwo-ml (ZKML prover)
# Usage: cargo build --features ml-prove
ml-prove = ["stwo-ml"]
ml-prove-gpu = ["ml-prove", "stwo-ml/cuda-runtime"]
[[bin]]
name = "sage-coordinator"
path = "src/bin/unified_coordinator.rs"
[[bin]]
name = "bitsage-proof"
path = "src/bin/proof_cli.rs"
[[bin]]
name = "sage-worker"
path = "src/bin/sage_worker.rs"
[[bin]]
name = "bench_poseidon_vs_blake"
path = "src/bin/bench_poseidon_vs_blake.rs"
[[bin]]
name = "test_poseidon_gpu"
path = "src/bin/test_poseidon_gpu.rs"
[[bin]]
name = "bench_gpu_vs_cpu"
path = "src/bin/bench_gpu_vs_cpu.rs"
[[bin]]
name = "benchmark_proof_pipeline"
path = "src/bin/benchmark_proof_pipeline.rs"
[[bin]]
name = "benchmark_poseidon_gpu"
path = "src/bin/benchmark_poseidon_gpu.rs"
# [patch.crates-io]
# No patches needed when using stable Rust