{"id":22799852,"url":"https://github.com/tangle-network/tnt-core","last_synced_at":"2026-03-05T09:01:35.251Z","repository":{"id":254866246,"uuid":"789121950","full_name":"tangle-network/tnt-core","owner":"tangle-network","description":"Core smart contract libraries for interacting with Tangle's cloud infrastructure.","archived":false,"fork":false,"pushed_at":"2026-03-01T01:05:18.000Z","size":37858,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T05:21:53.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tangle-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":"AUDIT-PAYMENTS.md","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-19T18:37:34.000Z","updated_at":"2026-03-01T01:05:22.000Z","dependencies_parsed_at":"2024-12-09T23:30:01.545Z","dependency_job_id":"a672f466-9e65-460f-aca7-66b52c555551","html_url":"https://github.com/tangle-network/tnt-core","commit_stats":null,"previous_names":["webb-tools/tnt-core","tangle-network/tnt-core"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/tangle-network/tnt-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Ftnt-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Ftnt-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Ftnt-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Ftnt-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tangle-network","download_url":"https://codeload.github.com/tangle-network/tnt-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Ftnt-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T07:10:09.463Z","updated_at":"2026-03-05T09:01:35.242Z","avatar_url":"https://github.com/tangle-network.png","language":"Rust","readme":"![Tangle Network Banner](https://raw.githubusercontent.com/tangle-network/tangle/refs/heads/main/assets/Tangle%20%20Banner.png)\n\n# TNT Core\n\n[![Discord](https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord\u0026logoColor=white)](https://discord.gg/cv8EfJu3Tn)\n[![Twitter](https://img.shields.io/twitter/follow/tangle_network?style=social)](https://twitter.com/tangle_network)\n\n**TNT Core** is an EVM-native staking and service protocol for Tangle Network. It provides multi-asset staking, operator networks, slashing, and x402 payment settlement through a modular Solidity contract architecture.\n\n### How Tangle Staking Compares\n\n| Feature | TNT Core (Tangle) | EigenLayer | Symbiotic |\n|---------|-------------------|------------|-----------|\n| Multi-asset staking | Native ERC-20 support | ETH and LSTs | Multi-asset via vaults |\n| Service registration | On-chain Blueprint registry | AVS contracts (separate) | Vault-based |\n| Payment models | PayOnce, Subscription, EventBased | Not built-in | Not built-in |\n| x402 payment settlement | Built-in | Not supported | Not supported |\n| Liquid delegation | LiquidDelegationVault | Via third-party LRT protocols | Via external vaults |\n| Operator management | OperatorStatusRegistry | Operator contract per AVS | Per-vault configuration |\n\nTangle Network's EVM-native staking and service blueprint protocol. Build decentralized services with customizable operator networks, multi-asset staking, and flexible payment models.\n\n## Installation\n\n```bash\nforge soldeer install tnt-core~0.10.4\n```\n\nOr add to `foundry.toml`:\n```toml\n[dependencies]\ntnt-core = \"0.10.4\"\n```\n\n## Quick Start\n\nCreate a custom blueprint by extending `BlueprintServiceManagerBase`:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.26;\n\nimport { BlueprintServiceManagerBase } from \"tnt-core/src/BlueprintServiceManagerBase.sol\";\n\ncontract MyBlueprint is BlueprintServiceManagerBase {\n    function onRequest(\n        uint64 requestId,\n        address requester,\n        address[] calldata operators,\n        bytes calldata requestInputs,\n        uint64 ttl,\n        address paymentAsset,\n        uint256 paymentAmount\n    ) external payable override onlyFromTangle {\n        // Validate service configuration\n        require(operators.length \u003e= 3, \"Need at least 3 operators\");\n        // Custom logic here\n    }\n\n    function onJobResult(\n        uint64 serviceId,\n        uint8 job,\n        uint64 jobCallId,\n        address operator,\n        bytes calldata inputs,\n        bytes calldata outputs\n    ) external payable override onlyFromTangle {\n        // Process job results, verify outputs, distribute rewards\n    }\n\n    // Optional: customize subscription non-payment grace policy.\n    // Default protocol behavior is one extra interval.\n    function getNonPaymentTerminationPolicy(uint64)\n        external\n        pure\n        override\n        returns (bool useDefault, uint64 graceIntervals)\n    {\n        return (false, 2); // wait 2 extra intervals\n    }\n}\n```\n\n## Core Contracts\n\n### Service Layer\n| Contract | Description |\n|----------|-------------|\n| `Tangle.sol` | Main entry point - composes all protocol functionality |\n| `BlueprintServiceManagerBase.sol` | Base contract for custom blueprints |\n| `MasterBlueprintServiceManager.sol` | Protocol-wide blueprint registry |\n| `MBSMRegistry.sol` | Versioned MBSM management |\n\n### Staking Layer\n| Contract | Description |\n|----------|-------------|\n| `MultiAssetDelegation.sol` | Multi-asset staking with O(1) share accounting |\n| `LiquidDelegationVault.sol` | ERC-7540 vault for liquid staking |\n| `OperatorStatusRegistry.sol` | Operator liveness tracking |\n\n### Key Interfaces\n| Interface | Description |\n|-----------|-------------|\n| `ITangle.sol` | Full Tangle interface |\n| `IBlueprintServiceManager.sol` | Blueprint hook interface |\n| `IMultiAssetDelegation.sol` | Staking interface |\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                         Tangle                               │\n│  ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────────────┐  │\n│  │Blueprints│ │ Services │ │   Jobs   │ │    Slashing     │  │\n│  └─────────┘ └──────────┘ └──────────┘ └─────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n                              │\n                              ▼\n┌─────────────────────────────────────────────────────────────┐\n│                  MultiAssetDelegation                        │\n│  ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────────────┐  │\n│  │Operators │ │ Deposits │ │Delegations│ │    Slashing     │  │\n│  └─────────┘ └──────────┘ └──────────┘ └─────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n                              │\n                              ▼\n┌─────────────────────────────────────────────────────────────┐\n│              Blueprint Service Managers                      │\n│         (Your custom service logic goes here)                │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Blueprint Lifecycle\n\n1. **Create Blueprint** - Developer deploys BSM and registers with Tangle\n2. **Operators Register** - Operators stake and register to serve the blueprint\n3. **Request Service** - Users request service instances with payment\n4. **Operators Approve** - Required operators approve the request\n5. **Service Active** - Jobs can be submitted and processed\n6. **Results \u0026 Rewards** - Operators submit results, rewards distributed\n\n## Payment Models\n\n- **PayOnce** - Single upfront payment\n- **Subscription** - Recurring billing from escrow\n- **EventBased** - Pay per job/event\n\n## Documentation\n\n- [Deployment Guide](https://github.com/tangle-network/tnt-core/blob/main/docs/DEPLOYMENT_RUNBOOK.md)\n- [Full Deploy Config](https://github.com/tangle-network/tnt-core/blob/main/docs/full-deploy.md)\n- [Pricing Models](https://github.com/tangle-network/tnt-core/blob/main/docs/PRICING.md)\n- [Interfaces](https://github.com/tangle-network/tnt-core/tree/main/src/interfaces)\n\n## Rust Bindings\n\n```bash\ncargo add tnt-core-bindings\n```\n\nSee [crates.io/crates/tnt-core-bindings](https://crates.io/crates/tnt-core-bindings)\n\n## Key Concepts\n\n- **Blueprint**: A specification for a verifiable, decentralized service on Tangle Network. Blueprints define jobs, verification logic, and slashing conditions through on-chain smart contracts.\n- **Operator**: A node runner who registers to provide services defined by a Blueprint. Operators stake assets via MultiAssetDelegation and earn rewards for honest execution.\n- **TNT**: The native token of Tangle Network, used for staking, governance, and payment settlement.\n- **Slashing**: The penalty mechanism that deducts staked assets from operators who misbehave or fail to perform their duties. Each Blueprint Service Manager defines its own slashing rules.\n- **x402**: An HTTP-native payment protocol (HTTP 402 Payment Required) that enables per-request micropayments for Blueprint services, with on-chain settlement through TNT Core contracts.\n- **MultiAssetDelegation**: The core staking contract that manages operator deposits, delegator stakes, and asset accounting across multiple ERC-20 tokens.\n- **BlueprintServiceManagerBase**: The base contract that Blueprint developers extend to define custom service logic, including request handling (`onRequest`), result processing (`onJobResult`), and termination policies.\n\n## FAQ\n\n### What is TNT Core?\n**TNT Core** is the on-chain smart contract protocol that powers Tangle Network's staking, delegation, and service management system. It is written in Solidity and deployed on Tangle's EVM-compatible chain.\n\n### What assets can be staked?\nTNT Core supports **multi-asset staking** through the MultiAssetDelegation contract. Operators and delegators can stake various ERC-20 tokens, not just the native TNT token. Each Blueprint can specify which assets it accepts.\n\n### How does slashing work?\nWhen an operator misbehaves or fails to perform their duties, the **BlueprintServiceManager** can slash their staked assets according to predefined rules. Slashing conditions are defined per-Blueprint and enforced through the MasterBlueprintServiceManager.\n\n### What payment models are available?\nTNT Core supports three payment models: **PayOnce** (one-time payment at service creation), **Subscription** (recurring payments), and **EventBased** (pay per event or job execution). These are configured in the Blueprint's pricing contract.\n\n### How do I build a custom Blueprint with TNT Core?\nExtend `BlueprintServiceManagerBase` in Solidity and implement the `onRequest` and `onJobResult` hooks. Install TNT Core via `forge soldeer install tnt-core~0.10.4` and import the base contract. See the Quick Start section above for a working example.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Ftnt-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangle-network%2Ftnt-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Ftnt-core/lists"}