Tangle Network's EVM-native staking and service blueprint protocol. Build decentralized services with customizable operator networks, multi-asset staking, and flexible payment models.
forge soldeer install tnt-core~0.8.0Or add to foundry.toml:
[dependencies]
tnt-core = "0.8.0"Create a custom blueprint by extending BlueprintServiceManagerBase:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import { BlueprintServiceManagerBase } from "tnt-core/src/BlueprintServiceManagerBase.sol";
contract MyBlueprint is BlueprintServiceManagerBase {
function onRequest(
uint64 requestId,
address requester,
address[] calldata operators,
bytes calldata requestInputs,
uint64 ttl,
address paymentAsset,
uint256 paymentAmount
) external payable override onlyFromTangle {
// Validate service configuration
require(operators.length >= 3, "Need at least 3 operators");
// Custom logic here
}
function onJobResult(
uint64 serviceId,
uint8 job,
uint64 jobCallId,
address operator,
bytes calldata inputs,
bytes calldata outputs
) external payable override onlyFromTangle {
// Process job results, verify outputs, distribute rewards
}
}| Contract | Description |
|---|---|
Tangle.sol |
Main entry point - composes all protocol functionality |
BlueprintServiceManagerBase.sol |
Base contract for custom blueprints |
MasterBlueprintServiceManager.sol |
Protocol-wide blueprint registry |
MBSMRegistry.sol |
Versioned MBSM management |
| Contract | Description |
|---|---|
MultiAssetDelegation.sol |
Multi-asset staking with O(1) share accounting |
LiquidDelegationVault.sol |
ERC-7540 vault for liquid staking |
OperatorStatusRegistry.sol |
Operator liveness tracking |
| Interface | Description |
|---|---|
ITangle.sol |
Full Tangle interface |
IBlueprintServiceManager.sol |
Blueprint hook interface |
IMultiAssetDelegation.sol |
Staking interface |
┌─────────────────────────────────────────────────────────────┐
│ Tangle │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │Blueprints│ │ Services │ │ Jobs │ │ Slashing │ │
│ └─────────┘ └──────────┘ └──────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ MultiAssetDelegation │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │Operators │ │ Deposits │ │Delegations│ │ Slashing │ │
│ └─────────┘ └──────────┘ └──────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Blueprint Service Managers │
│ (Your custom service logic goes here) │
└─────────────────────────────────────────────────────────────┘
- Create Blueprint - Developer deploys BSM and registers with Tangle
- Operators Register - Operators stake and register to serve the blueprint
- Request Service - Users request service instances with payment
- Operators Approve - Required operators approve the request
- Service Active - Jobs can be submitted and processed
- Results & Rewards - Operators submit results, rewards distributed
- PayOnce - Single upfront payment
- Subscription - Recurring billing from escrow
- EventBased - Pay per job/event
cargo add tnt-core-bindingsSee crates.io/crates/tnt-core-bindings
MIT