Pricing Engine (RFQ Server)
Tangle supports fixed pricing and RFQ (request-for-quote). The pricing engine is the operator-side gRPC server that generates EIP-712 signed quotes that users submit on-chain.
Protocol overview (pricing models, fixed per-job rates, RFQ semantics):
/developers/blueprints/pricing-and-payments
When to Use the Pricing Engine
- Use it when you want operators to answer RFQs off-chain (service creation quotes and/or per-job quotes).
- If your blueprint only uses fixed pricing (e.g. per-job rates via
setJobEventRates), you can skip it.
End-to-End Flow
The pricing engine supports two RFQ modes:
- Service creation quotes (
GetPrice) to use withcreateServiceFromQuotes/extendServiceFromQuotes - Per-job quotes (
GetJobPrice) to use withsubmitJobFromQuote
GetJobPriceResponse also includes optional x402 settlement fields (settlement_options, x402_endpoint). Clients that
do not use x402 can ignore them.
See the upstream README for exact semantics, flags, and configuration formats:
Operator Configuration (TOML)
These are the files operators typically tune:
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.
x402 Settlement Options (Optional)
The pricing engine has a programmatic integration point that can attach x402 settlement options to every per-job quote. This is intended to pair with the SDK’s x402 gateway.
At time of writing, the pricing-engine-server binary does not expose CLI flags for x402 settlement. If you want the
gRPC server to return x402 settlement options, you need to construct the pricing engine service in code using
PricingEngineService::with_x402_settlement, and run an x402 gateway at the returned x402_endpoint.
Source of Truth
- Pricing engine README: https://github.com/tangle-network/blueprint/blob/main/crates/pricing-engine/README.md
- Pricing proto: https://github.com/tangle-network/blueprint/blob/main/crates/pricing-engine/proto/pricing.proto
Best Practices
- Get multiple quotes from multiple operators and compare them.
- Verify signatures before using quotes on-chain.
- Check quote expiry before submission.
- Include complete security requirements in RFQ requests, otherwise quotes may not be usable for your desired service.
- Handle request failures and timeouts explicitly.
- Keep quote details intact. Never modify quote payloads after they are signed.
- Generate fresh proof-of-work per request if your deployment uses PoW gating.
- Expect price variation across operators.