Blueprint Pricing
Tangle v2 supports fixed-price and quote-based pricing. The pricing engine is the operator-side RFQ server that produces signed quotes for instant service creation.
When to Use the Pricing Engine
- Use it when your blueprint expects RFQ quotes and you want customers to create services immediately with signed operator quotes.
- If your blueprint uses standard pay-once or subscription pricing, you can skip the pricing engine.
End-to-End Flow
- Operator runs
pricing-engine-serverwith a pricing config and the Tangle RPC + contract addresses. - Customer requests quotes over gRPC (
GetPrice) with TTL, proof-of-work, and security requirements. - Operator returns a signed quote (ECDSA signature over ABI-encoded
QuoteDetails). - Customer creates a service by calling
ITangleServices.createServiceFromQuoteswith the selected quotes. UseextendServiceFromQuotesto add TTL later.
Quote Format
The gRPC schema matches ITangle.SignedQuote. The QuoteDetails payload looks like:
message QuoteDetails {
uint64 blueprint_id = 1;
uint64 ttl_blocks = 2;
double total_cost_rate = 3;
uint64 timestamp = 4;
uint64 expiry = 5;
repeated ResourcePricing resources = 6;
repeated AssetSecurityCommitment security_commitments = 7;
}Pricing Configuration
Pricing rates live in a TOML file. A default section applies to every blueprint, and you can override rates per
blueprint ID. The SDK ships a sample at
crates/pricing-engine/config/default_pricing.toml.
Runbook (Operator)
pricing-engine-server reads operator.toml and the pricing config, then watches the Tangle v2 contracts:
OPERATOR_HTTP_RPC=https://rpc.tangle.tools \
OPERATOR_WS_RPC=wss://rpc.tangle.tools \
OPERATOR_TANGLE_CONTRACT=0x... \
OPERATOR_RESTAKING_CONTRACT=0x... \
OPERATOR_STATUS_REGISTRY_CONTRACT=0x... \
cargo run -p blueprint-pricing-engine --bin pricing-engine-serverImportant environment variables:
OPERATOR_CONFIG_PATH(operator.toml)PRICING_CONFIG_PATH(pricing TOML)OPERATOR_HTTP_RPC/OPERATOR_WS_RPCOPERATOR_TANGLE_CONTRACTOPERATOR_RESTAKING_CONTRACTOPERATOR_STATUS_REGISTRY_CONTRACT
Security Notes
GetPriceuses proof-of-work to rate-limit RPC abuse.- Quotes include TTL + expiry and are signed with the operator ECDSA key to prevent replay.
Source of Truth
- Pricing engine README: https://github.com/tangle-network/blueprint/blob/v2/crates/pricing-engine/README.md
- Pricing proto: https://github.com/tangle-network/blueprint/blob/v2/crates/pricing-engine/proto/pricing.proto
- Get Multiple Quotes: Always request quotes from all registered operators to compare prices
- Verify All Signatures: Always verify the signature of each quote before using it
- Check Expiry Times: Ensure quotes haven’t expired before submitting them to the blockchain
- Include Complete Security Requirements: Specify all necessary security parameters in your requests
- Handle Errors Gracefully: Implement proper error handling for failed quote requests
- Keep Quotes Intact: Never modify quote details after receiving them
- Use Fresh Proof-of-Work: Generate a new proof-of-work for each request
- Expect Price Variation: Don’t assume all operators will provide the same price