update docs on gateawy, session keys & testnet#101
Conversation
badgersrus
left a comment
There was a problem hiding this comment.
Looks much better, nice one @zkokelj! Couple of minor tweaks to improve readability
| ``` | ||
|
|
||
| ## Example implementation | ||
| The gateway validates that the session key belongs to the user identified by `encryptionToken`, signs the transaction with the session key’s private key, and propagates it to the TEN node. |
There was a problem hiding this comment.
This sentence made it a little difficult to read. Could be something like:
The gateway first confirms that the session key belongs to the user identified by encryptionToken. It then signs the transaction with the session key’s private key and sends it to the TEN node.
| // This would be a normal transaction signed by the user's wallet | ||
| // transferring ETH to the session key address | ||
| } | ||
| This path is used in integration tests and may be preferred when your client already expects standard `eth_sendTransaction` semantics. The exact UX and error handling (e.g. non‑session‑key `from`) should follow the gateway implementation. |
There was a problem hiding this comment.
could we add a link to the gateway implementation?
There was a problem hiding this comment.
I decided that is it better to explain it more here in docs and not link to the source code as it is not that easy to read for someone who just wants to use session keys.
docs/4-write-ten-dapp/6-testnet.md
Outdated
| # Testnet | ||
|
|
||
| TEN Sepolia is our testnet that replicates the capabilities of the TEN Mainnet network. Linked to the Sepolia testnet, you can authenticate with the testnet TEN gateway, use the TEN faucet, and develop and deploy dApps for testing. | ||
| TEN Sepolia is our testnet that replicates the capabilities of the TEN Mainnet network. Linked to the Sepolia testnet, you can authenticate with the testnet TEN gateway, use the TEN faucet, and develop and deploy dApps for testing. |
There was a problem hiding this comment.
I think I wrote this paragraph originally (lol) but might be better worded:
TEN Sepolia is our testnet environment that mirrors the capabilities of the TEN Mainnet. In this environment, you can authenticate with the TEN testnet gateway, use the TEN faucet, and develop and deploy dApps for testing.
There was a problem hiding this comment.
Replaced, both versions sound good, but the new one is clearer.
docs/4-write-ten-dapp/6-testnet.md
Outdated
| Visit the TEN testnet gateway [here](https://testnet.ten.xyz/). Follow the on‑screen instructions to authenticate with the hosted gateway that allows you to interact with the testnet. | ||
|
|
||
| ## TEN Sepolia Faucet | ||
| ## Getting funds to the testnet |
There was a problem hiding this comment.
*Getting funds on the testnet?
docs/4-write-ten-dapp/6-testnet.md
Outdated
| 3. Choose how much Sepolia ETH you want to bridge from L1 to L2 (TEN). | ||
| 4. Confirm the transaction in your wallet and wait for it to finalize. | ||
|
|
||
| ## TEN Scan |
| **Endpoint:** `POST /v1/join/` | ||
|
|
||
| Generates and returns an EncryptionToken. | ||
| Creates a new gateway user, generates a fresh viewing key pair, and returns the corresponding **encryption token** (also called “gateway token”) as a hex string. This token is used with both HTTP endpoints and JSON‑RPC. |
There was a problem hiding this comment.
*This is used with HTTP and JSON-RPC endpoints
| **Endpoint:** `POST /v1/getmessage/` | ||
|
|
||
| Generates and returns a message (if needed 712 typed message too) for the user to sign based on the provided encryption token. | ||
| Generates and returns an authentication message for the user to sign based on the provided encryption token. The gateway can return either an EIP‑712 typed message or a `personal_sign` message. |
There was a problem hiding this comment.
When does it return EIP-712 vs personal_sign? I guess from a users perspective I'd be wondering what the difference is and if its deterministic
| "token": "<hex user token>" | ||
| } | ||
| ``` | ||
| - Validates the token, checks that the user exists, and sets a long‑lived `HttpOnly`, `Secure` cookie for use by browser dApps. |
There was a problem hiding this comment.
Not sure if this just the PR review view of this but appears to be some weird formatting?
No description provided.