Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/4-write-ten-dapp/1-high-level-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Below are the core concepts that make TEN unique while maintaining complete comp

All contract execution runs inside TEEs; inputs, state, and (optionally) logs can be private. See the [Overview](../1-overview.md) for architecture and threat model.

Clients establish HTTPS connections that terminate inside TEEs via the TEN Gateway, preventing plaintext exposure on intermediaries; smart contracts then execute entirely within the enclave boundary, and contract state plus sensitive metadata are stored encrypted at rest, with read access enforced through Viewing Keys and policy logic.
Clients establish HTTPS connections that terminate inside TEEs via the TEN Gateway, preventing plaintext exposure on intermediaries; smart contracts then execute entirely within the enclave boundary, and contract state plus sensitive metadata are stored encrypted at rest, with read access enforced through viewing keys and policy logic.

## Smart Contract Execution with Hidden State

Expand All @@ -23,12 +23,12 @@ Revisit [Data Acess](../3-smart-contract-features/1-data-access.md) for more inf
TEN introduces **[Smart Transparency](https://medium.com/obscuro-labs/web3-needs-access-control-9a80719eec4a)** — 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.

## TEN Gateway
Web service running in TEEs that provides the secure edge for dApps and user wallets:
The TEN Gateway runs as a service within a TEE, providing the secure edge for dApps and user wallets:

- Routes encrypted transactions between clients and validator/sequencer nodes
- Manages Viewing Keys on behalf of users for authenticated private view calls
- Manages Session Keys to enable no-click UX under developer-defined policies
- Caches encrypted metadata and frequently accessed data for performance and availability
- Routes encrypted transactions between clients and validator/sequencer nodes.
- Manages viewing keys on behalf of users for authenticated private view calls.
- Manages session keys to enable no-click UX under developer-defined policies.
- Caches encrypted metadata and frequently accessed data for performance and availability.

See [TEN Gateway](./6-testnet.md#ten-gateway) for more information.

Expand Down Expand Up @@ -85,12 +85,12 @@ The same code on TEN does not expose those attack vectors. It should be noted th
See [Secure Entropy](../3-smart-contract-features/2-native-entropy.md) for more information.


## Native Session Keys
## 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.

The management of these session keys is provided by the [ten-kit](https://github.com/ten-protocol/ten-kit/tree/2c4265bdb2832249af8c9ec21c4b60d02eb8dd3a?tab=readme-ov-file#advanced-example-with-session-keys) library, which provides the React components and hooks needed, as well as wallet connection and privacy‑preserving transactions.

See [Session Keys](./4-session-keys.md) for more information.
See [session keys](./4-session-keys.md) for more information.

---
13 changes: 9 additions & 4 deletions docs/4-write-ten-dapp/3-network-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Migrating to TEN enables your dApp to leverage “programmable encryption.” Be
- 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.
- Add features that make use of secure, verifiable randomness using `block.prevrandao` or precise timestamping

## 1. Configuring Hardhat
Expand All @@ -37,21 +36,27 @@ import { HardhatUserConfig } from "hardhat/config";
import "@nomiclabs/hardhat-waffle";
import "ten-hardhat-plugin";

const { PK } = process.env;

module.exports = {
solidity: "0.8.10",
defaultNetwork: "ten",
networks: {
hardhat: {
// Configuration for the Hardhat Network
// Configuration for the Hardhat Network
},
ten: {
url: "https://testnet.ten.xyz/v1/",
chainId: 8443,
accounts: ["your-private-key"],
useGateway: true,
accounts: [ `0x${PK}` ]
},
},
};

export default config;
```

Once configured, you can start writing or migrating your smart contracts.
Note in the above the private key is taken from an environment variable, rather than being put directly into the
configuration file. PKs should never be added directly into any files that might be subsequently made public, e.g.
through a public source code control system. Once configured, you can start writing or migrating your smart contracts.
2 changes: 1 addition & 1 deletion docs/4-write-ten-dapp/4-session-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 4
---

# Account Abstraction & Session Keys in TEN
# Account Abstraction & session keys in TEN

In the classic Account Abstraction model (EIP‑4337) described on [ethereum.org](https://ethereum.org/roadmap/account-abstraction/), “session keys” (SKs) are typically implemented using proxy smart contracts and a bundler.
TEN’s Account Abstraction design, outlined in [this post](https://medium.com/p/2e85bde4c54d), instead provides **native session keys managed by the gateway and TEEs**, eliminating the need for proxy contracts or a bundler.
Expand Down
9 changes: 5 additions & 4 deletions docs/4-write-ten-dapp/5-bridging.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ sidebar_position: 5
---
# Cross-Chain Bridging

The TEN Bridge project aims to facilitate the seamless transfer of assets between the Ethereum blockchain and the TEN blockchain. This documentation provides an overview of the project, its purpose, supported tokens, and usage instructions.
The TEN Bridge facilitates the seamless transfer of assets between the Ethereum blockchain and the TEN blockchain. This documentation provides an overview of the bridge, its purpose, supported tokens, and usage instructions.

## Purpose

The primary goal of the TEN Bridge is to enable users to move assets between Ethereum and TEN efficiently and securely. This bridge will serve as a vital infrastructure component for users who wish to interact with assets on both blockchains. (Link TBC)
The primary goal of the TEN Bridge is to enable users to move assets between Ethereum and TEN efficiently and securely. It serves as a vital infrastructure component for users who wish to interact with assets on both blockchains.

## Supported Tokens

To provide flexibility and utility to users, the TEN Bridge supports the following tokens:
To provide flexibility and utility to users, the bridge supports the following tokens:
- Ethereum (ETH)
- TEN token (TEN)
- Tether (USDT)
Expand All @@ -23,10 +23,11 @@ To provide flexibility and utility to users, the TEN Bridge supports the followi

Before using the TEN Bridge, ensure you have the following:
- MetaMask or any Ethereum-compatible wallet
- Navigate to the [TEN Bridge UI](https://testnet-bridge.ten.xyz/)

### Steps to Transfer Assets

1. Connect your Ethereum wallet (e.g., MetaMask) to the TEN Bridge interface.
1. Connect your Ethereum wallet (e.g. MetaMask) to the TEN Bridge interface.
2. Select the asset you wish to transfer and specify the destination blockchain (Ethereum or TEN).
3. Enter the amount of the asset you want to transfer.
4. Review the transaction details and confirm the transfer.
Expand Down