DevelopersBlueprintsPricing

Blueprint Pricing

This guide explains the RFQ (“request for quote”) pricing flow used to create services from signed operator quotes on Tangle.

Prerequisites

  • Understanding of Blueprint concepts and execution model
  • Familiarity with the service lifecycle (request/approve vs RFQ/quotes)
  • Basic knowledge of signatures and replay protection

Pricing Workflow

The end-to-end flow looks like:

  1. Find operators: discover operators registered for a blueprint.
  2. Request quotes: call each operator’s pricing endpoint (usually gRPC) and request a quote for the desired TTL and requirements.
  3. Verify quotes: verify operator signatures and enforce expiry.
  4. Create service from quotes: submit quotes on-chain via createServiceFromQuotes(...) and pay the sum of totalCost.
  5. Run jobs: submit jobs to the service; operators submit results; fees are distributed by the protocol.

Where Quotes Come From

Operators typically run the SDK’s pricing server (pricing-engine-server) which:

  • Computes costs from the local policy file and benchmark cache.
  • Returns SignedQuote payloads that can be submitted directly to the Tangle contract.
  • Signs quotes as EIP-712 typed data under the TangleQuote domain (version 1) for the target chain + Tangle contract address.

Operators must configure the server with the correct deployment addresses (notably OPERATOR_TANGLE_CONTRACT) so signatures verify on-chain.

Implementation Steps

1. Discover operators and endpoints

Operators publish an endpoint string as part of their on-chain preferences. Use that endpoint to request quotes out-of-band.

2. Request quotes

Quote requests typically include:

  • blueprintId
  • ttl
  • Optional security requirements and other blueprint-specific config
  • Optional proof-of-work (if the operator enables it)

3. Submit createServiceFromQuotes

Submit the quotes on-chain and pay the total cost. The contract verifies:

  • The quote signature(s)
  • TTL and expiry constraints
  • Per-operator replay protection (quotes cannot be reused)
  • The signed security commitments (quotes must not be modified after receipt)

Understanding Pricing Calculations

Operators can use any internal pricing model. A common shape is:

Price = Resource Cost × Duration Factor × Security Factor

The service’s totalCost is typically the sum of the operator quotes.

Where:

  • Resource Cost = resource_count × price_per_unit_rate
  • Duration Factor = time_blocks × BLOCK_TIME
  • Security Factor = Factor based on security requirements

Understanding this helps you estimate costs and evaluate quotes effectively.

Best Practices

  1. Get Multiple Quotes: Always request quotes from all registered operators to compare prices
  2. Verify All Signatures: Always verify the signature of each quote before using it
  3. Check Expiry Times: Ensure quotes haven’t expired before submitting them to the blockchain
  4. Use conservative security requirements: Prefer explicit requirements and bounded TTLs
  5. Handle Errors Gracefully: Implement proper error handling for failed quote requests
  6. Keep Quotes Intact: Never modify quote details after receiving them
  7. Use fresh proof-of-work (if enabled): Generate a new proof-of-work for each request
  8. Expect Price Variation: Don’t assume all operators will provide the same price