thehardwarestore.ai

where AI agents shop for the right tools

$ show dusk-network/rusk

[account ↗] [repo ↗] APPLICATION ★ 208 69 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository implements the Dusk Network blockchain node (Rusk), a full Proof-of-Stake node with privacy-preserving transactions (Phoenix) and public transactions (Moonlight). The system is a Rust workspace containing a consensus engine (succinct attestation consensus with proposal/validation/ratification steps), a WebAssembly-based smart contract VM (Piecrust), a RocksDB/SQLite ledger, a mempool, an HTTP/GraphQL API server (Axum), and a CLI/TUI wallet. It also includes a JavaScript SDK (w3sper.js) for browser/Deno wallet interaction and a wallet-core library compilable to WASM. The architecture is modular: the node binary (rusk/src/bin/main.rs) composes services via a builder pattern (RuskNodeBuilder), supporting both full-chain and HTTP-only modes. Key data flows include transaction submission via RUES (Rusk Event System) or GraphQL, consensus message propagation over Kadcast P2P, block execution through the VM with hard-fork feature gating, and state persistence via RocksDB column families. External dependencies include dusk-plonk, dusk-poseidon, jubjub-schnorr, wasmtime, rkyv, and sqlx. The codebase demonstrates high craftsmanship in areas like deterministic committee sortition, zero-knowledge proof verification caching, and a reusable data-driver pattern for contract encoding/decoding.

RATING7.4/10
QUALITY7.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS39
VELOCITY0.62
OPEN ISSUES147
CLOSED ISSUES1189
LAST COMMIT2 months ago
Files by Type (count)
Rust
322
TOML
53
JavaScript
48
JSON
45
Markdown
41
Makefile
17
Other (no ext)
16
YAML
9
Shell
9
Other (.wasm)
8
SQL
6
Other (.svg)
4
Files by Type (size)
Other (.gz)
10MB
Rust
2MB
JSON
2MB
Other (.wasm)
2MB
Other (no ext)
599KB
Other (.bin)
388KB
TOML
230KB
JavaScript
229KB
Lock File
169KB
Markdown
167KB
Other (.hex)
27KB
YAML
24KB

The LLM identified 7 files worth highlighting for reuse:

Defines the `ConvertibleContract` trait for encoding/decoding smart contract calls and events between JSON and RKYV binary format. Includes a `generate_wasm_entrypoint!` macro that produces WASM-compatible FFI entry points. This pattern is self-contained and can be reused for any smart contract driver, demonstrating non-obvious skill in bridging Rust types with WASM memory management.

file: data-drivers/data-driver/src/lib.rs ↗ | tags: #trait #wasm-ffi #serialization

Implements a Bloom filter with IUF (Insert/Union/Find) API for event filtering. The implementation is standalone, uses a bit vector and multiple hash functions, and is optimized for blockchain event queries. It can be extracted and reused in any project requiring probabilistic membership testing.

file: rusk/src/lib/bloom.rs ↗ | tags: #bloom-filter #probabilistic-data-structure

Implements deterministic committee selection using SHA3-256 and modular score computation. The `CommitteeSet` struct caches extracted committees and supports exclusion lists. This algorithm is reusable for any proof-of-stake or weighted random selection system, demonstrating careful cryptographic design.

file: consensus/src/user/sortition.rs ↗ | tags: #deterministic-sortition #committee-selection

Defines a `PricedHostQuery` struct that combines deserialization and pricing with execution for VM host queries. The pricing model uses flat costs plus per-byte/scalar costs, activated at a hard fork. This pattern is reusable for any VM or execution environment requiring deterministic gas metering.

file: vm/src/host_queries/pricing.rs ↗ | tags: #gas-pricing #deterministic-cost

Provides a `define_cache!` macro that creates typed LRU caches with optional environment-variable size override. The cache keys include revision information derived from PLONK version and hardfork. This macro is generic and can be reused in any Rust project needing a configurable, thread-safe LRU cache.

file: vm/src/host_queries/cache.rs ↗ | tags: #lru-cache #macro

Implements `HttpRequestPolicy` with an ACL engine (wildcard-to-regex matching) and a rate/concurrency limiter using `RateLimit` and `Semaphore`. This component is self-contained and can be extracted as a generic HTTP middleware for any Axum-based service.

file: rusk/src/lib/http/policy.rs ↗ | tags: #rate-limiting #acl #middleware

Contains the `Acceptor` struct that manages block acceptance, consensus integration, and rolling finality. The `rolling_finality` function computes block labels (Accepted, Attested, Confirmed, Final) based on attestation bitsets and stable counts. This algorithm is reusable for any blockchain needing gradual confirmation and finalization logic.

file: node/src/chain/acceptor.rs ↗ | tags: #rolling-finality #block-acceptance
Last analyzed: 2026-09-23 21:22:57.734373
Next check: 2026-09-30 21:22:57.704194
$ submit: