| Crates.io | blueprint-pricing-engine |
| lib.rs | blueprint-pricing-engine |
| version | 0.2.4 |
| created_at | 2025-04-22 14:03:45.015931+00 |
| updated_at | 2025-08-11 20:18:47.174839+00 |
| description | Tangle Cloud Pricing Engine for service offerings |
| homepage | https://tangle.tools |
| repository | https://github.com/tangle-network/blueprint |
| max_upload_size | |
| id | 1644083 |
| size | 579,669 |
This system defines a simplified decentralized pricing mechanism in which each operator runs a local RPC server to respond to user price requests. Prices are generated based on benchmarking configurations for specific blueprints and cached in a local key-value store. When a user requests a quote, the operator returns a signed price quote that includes an expiry block number or timestamp for on-chain verification.
graph TD
subgraph Operator
A1["Blueprint Registered or Price Updated"] --> B1["Run Benchmark"]
B1 --> C1["Compute Price for Blueprint"]
C1 --> D1["Store Price in Cache (KV DB)"]
E1["Incoming Price Request"] --> F1["Lookup Price in Cache"]
F1 --> G1["Sign Price with Expiry"]
G1 --> H1["Send Price Response"]
end
subgraph User
H1 --> I1["Verify Signature"]
I1 --> J1["Submit Quote On-chain"]
end
operator_rfq/
├── Cargo.toml
├── src/
│ ├── main.rs # RPC server + request handler
│ ├── benchmark.rs # Benchmarking logic per blueprint
│ ├── pricing.rs # Price computation engine
│ ├── cache.rs # Local DB wrapper (RocksDB or SQLite)
│ ├── signer.rs # Signature generation + verification
│ └── proto/ # gRPC proto definitions
└── README.md # This file
price_cache[blueprint_hash] = PriceModel { price_per_unit, timestamp }GetPrice(blueprint_hash) RPC request.SignedQuote { price, blueprint_hash, timestamp, signature }struct QuotePayload {
blueprint_hash: [u8; 32],
price_wei: u128,
timestamp_or_block: u64,
}
Hash with sha256, sign with ed25519:
let msg = sha256(encode(&QuotePayload));
let sig = keypair.sign(&msg);
# Build the server
cargo build --release
# Run the gRPC server
cargo run --bin operator_rfq
MIT or Apache 2.0