-
Notifications
You must be signed in to change notification settings - Fork 27
Mainnet Docs Update #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
3cfe675
78a066f
a4fcb62
0921e55
885f9a9
7db3a24
ac595d0
25843cc
e6f48b0
5951c3d
fabb585
8ffdb7e
fc07a28
caabdb6
e22fc06
df7f197
6321b1a
9f36132
24a028f
e0fe280
5af69fc
9d39f17
56c94d4
6d073a9
a2a9f6a
4a11c70
7f5228f
2a00836
7801978
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "label": "Overview", | ||
| "position": 1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "label": "Introduction", | ||
| "position": 2 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| sidebar_position: 2 | ||
| --- | ||
|
|
||
| # Chain Information | ||
|
|
||
| ## TEN Public RPC Endpoints TODO | ||
|
|
||
| :::caution | ||
| - TEN Protocol RPC endpoints support standard Ethereum JSON-RPC methods with additional privacy features | ||
| - All transactions are encrypted by default - use TEN-compatible wallets and tools | ||
| - View the [faucet](https://faucet.ten.xyz/) for testnet tokens | ||
| ::: | ||
|
|
||
| This section provides an overview of the available public RPC endpoints for TEN Protocol networks and necessary details to interact with them. | ||
|
|
||
| | Name | RPC Url(s) | Chain ID | Block explorer | Underlying chain | Tech stack | Faucet | | ||
| |------|------------|----------|----------------|------------------|------------|---------| | ||
| | TEN Sepolia Testnet | `https://testnet.ten.xyz/v1/` | `8443` | [TENscan](https://tenscan.io/) | Ethereum Sepolia | Confidential Rollup (TEE) | [Faucet](https://faucet.ten.xyz/) | | ||
|
|
||
| :::info More RPC endpoints | ||
| Additional TEN Protocol RPC endpoints and infrastructure providers will be listed here as they become available. | ||
| ::: | ||
|
|
||
| # JSON-RPC API | ||
|
|
||
| TEN offers compatibility with a subset of Ethereum's [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/). This document outlines the supported JSON-RPC API methods. | ||
|
|
||
| ## Supported Methods | ||
|
|
||
| TEN nodes cater to the following JSON-RPC API methods, accessible via both HTTP and websockets: | ||
|
|
||
| - `eth_blockNumber` | ||
| - `eth_call` | ||
| - `eth_chainId` | ||
| - `eth_estimateGas` | ||
| - `eth_gasPrice` | ||
| - `eth_getBalance` | ||
| - `eth_getBlockByHash` | ||
| - `eth_getBlockByNumber` | ||
| - `eth_getCode` | ||
| - `eth_getLogs` | ||
| - `eth_getTransactionByHash` | ||
| - `eth_getTransactionCount` | ||
| - `eth_getTransactionReceipt` | ||
| - `eth_sendRawTransaction` | ||
|
|
||
| ## Websocket Subscriptions | ||
|
|
||
| For websocket connections, additional API methods include: | ||
|
|
||
| - `eth_subscribe` | ||
| - `eth_unsubscribe` | ||
|
|
||
| Currently, the sole supported subscription type is `logs`. | ||
|
|
||
| ## Network Configuration | ||
|
|
||
| ### TEN Sepolia Testnet | ||
|
|
||
| To add TEN Sepolia Testnet to your wallet, use the following configuration: | ||
|
|
||
| ```json | ||
| { | ||
| "chainId": "0x1BB", | ||
| "chainName": "TEN Sepolia Testnet", | ||
| "rpcUrls": ["https://testnet.ten.xyz/v1/"], | ||
| "nativeCurrency": { | ||
| "name": "Ether", | ||
| "symbol": "ETH", | ||
| "decimals": 18 | ||
| }, | ||
| "blockExplorerUrls": ["https://tenscan.io/"] | ||
| } | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| sidebar_position: 1 | ||
| --- | ||
|
|
||
| # What is TEN Protocol? | ||
|
|
||
| TEN is a next-generation Ethereum Layer 2 rollup protocol that introduces data confidentiality, computational privacy, and resistance to Maximal Extractable Value (MEV) by leveraging hardware-based Trusted Execution Environments (TEEs). TEN represents a major step forward in decentralized system design by reintroducing **data access controls** — a foundational feature of Web2 that Web3 largely abandoned in favor of radical transparency. | ||
|
|
||
| ## The Web3 Privacy Problem | ||
|
|
||
| Public blockchains have validated the promise of programmable value, but exposed a critical flaw: the complete absence of data access control. Transparency, once celebrated as a virtue, has become a liability. On-chain activity today remains fully public — every balance, transaction, strategy, and piece of logic is visible to everyone, including competitors, adversaries, and MEV bots. | ||
|
|
||
| If you analyze any successful digital application — Netflix, WhatsApp, Spotify, banking apps, even mobile games — they all rely on access control. Not just for privacy, but to function. Smart contracts today can define who can write data, but they cannot restrict who can read it. This fundamental limitation makes it nearly impossible to build viable real-world applications in Web3 beyond speculation. | ||
|
|
||
| ## TEN's Solution: Smart Transparency | ||
|
|
||
| TEN introduces **Smart Transparency** — a paradigm where smart contracts not only enforce rules of computation, but also enforce rules of data access. By integrating programmable encryption, TEEs, and an Ethereum-compatible execution environment, TEN enables encrypted, autonomous, and composable smart contracts that preserve privacy without sacrificing decentralization or composability. | ||
|
|
||
| ### Core Architecture | ||
|
|
||
| **Encrypted Execution**: All transactions and internal state of application contracts remain encrypted and hidden, providing a credible solution to MEV while maintaining EVM compatibility for easy migration of existing contracts. | ||
|
|
||
| **Trustless Design**: TEN leverages TEEs for privacy but not for integrity. If a TEE is compromised or a manufacturer behaves maliciously, the system gracefully degrades into a transparent blockchain, preserving ledger integrity while forfeiting privacy. | ||
|
|
||
| **Ethereum Foundation**: TEN uses Ethereum as a base layer for security and data availability while enabling lower transaction costs similar to other Layer 2 networks, with quick finality synchronized to L1 block cadence. | ||
|
||
|
|
||
| ## Key Differentiators from Transparent Chains | ||
|
|
||
| | Feature | Transparent Chains | TEN Protocol | | ||
| |---------|-------------------|--------------| | ||
| | **Data Access** | All data public | Programmable access control | | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also add the usual stuff like:
|
||
| | **MEV Protection** | Limited solutions | Built-in confidentiality | | ||
| | **Smart Contract State** | Fully visible | Encrypted with selective disclosure | | ||
| | **Transaction Privacy** | Public by default | Private by default | | ||
| | **Compliance** | Difficult | Time-delayed revelation for deterrence | | ||
|
|
||
| ## Addressing Key Challenges | ||
|
|
||
| **Hardware Trust**: TEN's trust model doesn't require perpetual belief in any single hardware vendor. The protocol uses Ethereum's security combined with game theory to detect and correct eventual TEE compromises. | ||
|
|
||
| **Usability**: The system implements flexible policies for delayed transaction revelation, balancing privacy needs with regulatory compliance and illegal activity deterrence. | ||
|
|
||
| **MEV Prevention**: Beyond hiding transactions, TEN introduces delays at critical moments to prevent aggregators from performing replay-attacks and exploiting side-channels. | ||
|
|
||
| ## Unlocking New Applications | ||
|
|
||
| TEN's confidential rollup architecture enables previously impossible on-chain applications: | ||
|
|
||
| - **Confidential DeFi**: Dark pools, private lending, MEV-resistant trading | ||
| - **Private Gaming**: Poker, strategy games with hidden information | ||
| - **Autonomous AI Agents**: Protected algorithms and private coordination | ||
| - **Enterprise Solutions**: Confidential auctions, private supply chains | ||
| - **TEE-Stablecoins**: Reserve-backed with provable but confidential attestation | ||
|
|
||
| ## Whitepaper & Blog Links | ||
| - [TEN Protocol Whitepaper](https://github.com/ten-protocol/ten-whitepaper/blob/main/whitepaper.md) | ||
| - [SGX Demystified](https://medium.com/obscuro-labs/intel-sgx-demystified-757a242682a3) | ||
| - [Smart Transparency](https://medium.com/obscuro-labs/web3-needs-access-control-9a80719eec4a) | ||
| - [Securing Randomness](https://medium.com/obscuro-labs/against-all-odds-securing-randomness-on-the-blockchain-4c15587a39a8) | ||
| - [High-Level Explanation](https://medium.com/obscuro-labs/ten-in-a-nutshell-for-devs-874666910f65) | ||
| - [iGaming Features](https://medium.com/@tudor.malene/the-ideal-gaming-chain-bb5674202ec2) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| sidebar_position: 1 | ||
| --- | ||
|
|
||
| # High level concepts | ||
|
|
||
| TEN Protocol is fully **Ethereum-compatible**, meaning you can use all your familiar development tools; Solidity, Hardhat, Foundry, MetaMask, and Remix, without any changes. The key difference is that TEN adds powerful privacy and confidentiality features on top of the standard EVM functionality. | ||
|
|
||
| Below are the core concepts that make TEN unique while maintaining complete compatibility with existing Ethereum tooling and workflows. | ||
|
|
||
| ## End-to-End Encryption | ||
|
|
||
| TEN implements comprehensive end-to-end encryption through its **Encrypted EVM** architecture. All smart contract execution occurs inside **Trusted Execution Environments (TEEs)**, ensuring that transaction data, contract logic, inputs, and state remain encrypted and private from all external observers—including node operators and validators. | ||
|
||
|
|
||
| ## Smart Contract Execution with Hidden State | ||
|
|
||
| Unlike Ethereum where all contract state is publicly visible, TEN provides **genuine private variables** through its encrypted execution environment. TEN disables `getStorageAt` and ensures private variables are truly private, only accessible through authorized functions that developers define. | ||
badgersrus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Data Access Control Primitives | ||
|
|
||
| TEN introduces **Smart Transparency**—a paradigm where smart contracts enforce rules of data access, not just computation. This provides fine-grained control over who can see what data and when, including programmable disclosure, conditional data access, and event visibility rules. | ||
badgersrus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## TEN Gateway | ||
| The TEN Gateway securely routes encrypted transactions between users and validator nodes, ensuring data confidentiality throughout the transaction process. | ||
badgersrus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Personal Data | ||
|
|
||
| TEN enables true **personal data** management on-chain by ensuring that sensitive user information remains encrypted and accessible only to authorized parties. This supports applications like private messaging, confidential medical records, and identity verification systems while maintaining compliance with data protection regulations. | ||
|
|
||
| ## Free Native On-Chain Randomness | ||
|
|
||
| TEN provides **secure, immediate, and free randomness** without oracles or external dependencies. Random numbers are generated within secure enclaves, ensuring unpredictability while eliminating the delays, complexity, and fees associated with traditional oracle-based solutions. | ||
|
|
||
| ```solidity | ||
| function getRandomNumber() public view returns (uint256) { | ||
| return uint256(block.prevrandao); // Secure randomness on TEN | ||
| } | ||
| ``` | ||
|
|
||
| ## Precise Timestamping of Transactions | ||
|
|
||
| Every transaction on TEN receives a **precise timestamp** when it reaches the sequencer, enabling applications that require exact timing information such as real-time games, auction systems, and time-sensitive financial instruments. | ||
|
|
||
| ## Native Commit-Reveal (Required by Many Games) | ||
|
|
||
| TEN eliminates the need for traditional commit-reveal schemes through its **native async execution** and **on-block-end callbacks**. This provides the same security benefits without the complexity, latency, and cost of separate commit and reveal transactions, enabling seamless gaming experiences. | ||
|
|
||
| ## Native Session Keys | ||
|
|
||
| TEN provides **native session key** support managed by TEEs, eliminating the need for proxy contracts while enabling seamless user experiences. Users can play games or interact with dApps without signing every transaction, while developers benefit from simple integration through standard RPC endpoints. | ||
|
|
||
| --- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| sidebar_position: 3 | ||
| --- | ||
|
|
||
| # Migrate your dApp to TEN | ||
|
|
||
| Migrating to TEN enables your dApp to leverage "Programmable Encryption". Below are steps to help you transition smoothly. | ||
|
|
||
| ### Key Migration Steps | ||
|
|
||
| - Update your Hardhat deployment to support the `--network ten` option. | ||
| - Add data protection logic to your view functions (if applicable). | ||
| - Configure visibility rules for event logs and internal storage. | ||
| - Add the TEN onboarding widget to your JavaScript UI. | ||
|
|
||
| ## 1. Configuring Hardhat | ||
|
|
||
| First, set up a Hardhat project if you haven't already. | ||
|
|
||
| ### 1.1 Installing the TEN Hardhat Plugin | ||
|
|
||
| To add TEN Network compatibility, install the `ten-hardhat-plugin`: | ||
|
|
||
| ```bash | ||
| npm install ten-hardhat-plugin | ||
| ``` | ||
|
|
||
| _You can use `npm` or `yarn` to install plugins._ | ||
|
|
||
| ### 1.2 Configuring `hardhat.config.js` | ||
|
|
||
| Modify `hardhat.config.js` in your project’s root directory as follows: | ||
|
|
||
| ```javascript | ||
| import { HardhatUserConfig } from "hardhat/config"; | ||
| import "@nomiclabs/hardhat-waffle"; | ||
| import "ten-hardhat-plugin"; | ||
|
|
||
| module.exports = { | ||
| solidity: "0.8.10", | ||
| networks: { | ||
| hardhat: { | ||
| // Configuration for the Hardhat Network | ||
| }, | ||
| ten: { | ||
| url: "https://testnet.ten.xyz/v1/", | ||
| chainId: 443, | ||
badgersrus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| accounts: ["your-private-key"], | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default config; | ||
| ``` | ||
|
|
||
| Once configured, you can start writing or migrating your smart contracts. | ||
Uh oh!
There was an error while loading. Please reload this page.