Tangle Network Blueprint SDK

repository·main·Indexed 43 days ago

https://github.com/tangle-network/blueprint

A modular Rust toolkit and CLI tool (cargo-tangle v0.5.0-alpha.14) for building, deploying, and managing decentralized services called Blueprints on the Tangle Network, an EVM-based protocol. The SDK enables blueprint creation, on-chain registration, version publishing, and service request management, with integrated support for IPFS pinning, attestation submission, and trust score calculation for CI gating.

Tokens
187.8K
Snippets
529
Records
794
Agent score
55%

What's inside Tangle Network

  1. Overview of blueprint-tangle-aggregation-svc

    main

    The blueprint-tangle-aggregation-svc is a BLS (Boneh-Lynn-Shacham) signature aggregation service designed for Tangle workflows. It provides the infrastructure necessary to collect multiple signatures from different operators and combine them into a single aggregate signature.

    Key components include:

    • An HTTP API for managing the lifecycle of an aggregation task (initialization, signature submission, status checking, and result retrieval).
    • Aggregation service/state types and various persistence backends to manage the state of ongoing tasks.
    • An optional client module to simplify interaction with the service.
  2. What is blueprint-x402?

    main

    The blueprint-x402 crate provides a payment gateway for the Blueprint SDK, enabling paid HTTP job execution for Blueprint runners. It supports two parallel wire protocols for client settlement:

    1. x402: Uses X-PAYMENT and X-Payment-Response headers via the x402-axum crate.
    2. MPP (Machine Payments Protocol): An IETF standards-track scheme using WWW-Authenticate: Payment, Authorization: Payment, and Payment-Receipt headers. This is enabled by adding an [mpp] section to your configuration.

    Both protocols share the same job pricing, accepted tokens, restricted-auth modes, and the X402Producer stream that converts verified payments into JobCalls.

  3. Overview of Blueprint FaaS

    main
    Blueprint FaaS provides Function-as-a-Service (FaaS) execution support for the Blueprint SDK. It uses a trait-based integration that allows blueprints to delegate specific jobs to serverless providers while running other jobs locally. This enables cost optimization for infrequent or bursty workloads and provides isolation for compute-intensive tasks.
  4. Overview of Blueprint SDK Crates

    main

    The Blueprint SDK is composed of several Rust crates organized into functional families. Developers can choose specific crates based on whether they are building core runtimes, ingress mechanisms, protocol integrations, or security and utility layers.

    Core Runtime

    Used for building the fundamental execution logic of a Blueprint application:

    • blueprint-sdk: The umbrella crate for most Blueprint applications.
    • blueprint-core: Core job and runtime primitives.
    • blueprint-router: The layer responsible for dispatching job IDs to handlers.
    • blueprint-runner: Handles the runtime loop and orchestration.

    Trigger and Ingress

    Used to define how jobs are triggered or how data enters the system:

    • blueprint-producers-extra: Protocol-agnostic producers (e.g., cron jobs).
    • blueprint-webhooks: Authenticated HTTP webhook ingress.
    • blueprint-x402: Paid HTTP ingress via x402 settlement.

    Protocol and Integration

    Used to connect Blueprints to external networks and protocols:

    • blueprint-tangle-extra: Tangle protocol integrations.
    • blueprint-evm-extra: EVM integration helpers.
    • blueprint-eigenlayer-extra: EigenLayer integration helpers.
    • blueprint-clients: A metapackage containing various protocol client crates.

    Security, Ops, and Support

    Used for managing authentication, quality of service, and operational stability:

    • blueprint-auth: Auth proxy and request authentication primitives.
    • blueprint-qos: Surfaces for heartbeats, metrics, and logging.
    • blueprint-manager: Manager runtime orchestration.
    • blueprint-manager-bridge: Bridge types between the manager and services.
    • blueprint-keystore: Signing and key management.
    • blueprint-pricing-engine: RFQ and pricing server components.

    Utility Families

    Shared tools and metapackages:

    • blueprint-crypto: Crypto algorithms and metapackages.
    • blueprint-metrics: Metrics providers and metapackages.
    • blueprint-stores: Storage provider crates.
    • blueprint-testing-utils: Testing helpers and metapackages.
    • blueprint-chain-setup: Helpers for local chain setup.
    • blueprint-build-utils: Build-time helpers.
    • blueprint-std: Shared standard exports and utilities.
    • blueprint-macros: Procedural macro support.
  5. Overview of blueprint-manager

    main

    The blueprint-manager is the runtime manager for the Blueprint ecosystem, responsible for orchestrating service execution. Its primary responsibilities include:

    • Runtime Orchestration: Managing the lifecycle and execution of Blueprint services.
    • Source Resolution: Loading runtime configurations and resolving protocol or runtime sources.
    • Execution Coordination: Coordinating how services interact and execute within the network.
    • Integration: Providing an integration surface for the manager bridge and authentication components.
  6. Overview of the Operator RFQ Pricing Server

    main

    The Operator RFQ Pricing Server is a gRPC server that generates EIP-712 signed price quotes for Tangle services and jobs. Operators run this alongside their blueprint node to allow service consumers to request quotes via gRPC, which can then be submitted on-chain.

    It supports two primary modes of operation:

    1. Service Creation RFQ (GetPrice): Used to quote the totalCost for running an entire service instance for a specific TTL. This is used with createServiceFromQuotes() on the Tangle contract.
    2. Per-Job RFQ (GetJobPrice): Used to quote a specific price for a single job execution. This is used with submitJobFromQuote() on the Tangle contract.

    Important Security Note: Since tnt-core v0.13.0, every quote is bound to a specific requester address. The on-chain verifier rejects quotes where requester == address(0) and rejects any submitter whose msg.sender does not match the requester address.

  7. Overview of blueprint-manager-bridge

    main

    The blueprint-manager-bridge crate provides the communication layer between the manager and service processes. It defines the shared API types, error handling, and security profiles required for these two entities to interact reliably.

    Key components include:

    • Shared API Types: Data structures used by both the manager and the runtime processes to ensure consistent communication.
    • Client/Server Modules: Optional modules for implementing the bridge, which can be toggled via feature flags.
    • TLS Profiles: Security configurations for establishing encrypted connections.
    • Bridge Error Types: Standardized error definitions for diagnosing communication failures between the manager and service.
  8. Overview of blueprint-crypto-core

    main
    The blueprint-crypto-core crate provides the foundational cryptographic building blocks for the Blueprint ecosystem. It defines shared cryptographic traits and aggregation primitives that are consumed by specific algorithm-implemented crates. This ensures a consistent interface for cryptographic operations across the network.
  9. Overview of blueprint-auth toolkit

    main

    The blueprint-auth crate is an authentication and authorization toolkit designed for Blueprint services. It provides primitives for managing request authentication and an auth proxy surface at HTTP/WS service edges.

    Key capabilities include:

    • Managing API key and short-lived access token flows.
    • Extracting authentication context from incoming requests.
    • Providing proxy and server authentication modules.
    • Offering TLS and certificate helpers to secure service edges.