Explore in Telegram

apiton blog

Put your website on your .ton domain: how apiton serves it as a TON Site

· 7 min read · ton-sites, domains, ton-dns

Open in @apitonBotcheck any username, number or domain live in Telegram

Most .ton domains point to a wallet or to nothing at all. A domain can also open a website of its own, a TON Site, but that usually means running a server inside the TON network. If you already have an ordinary website and a .ton domain, Your website on .ton lets apiton be that server for you: a visitor opens http://shop.ton/ and gets the pages of https://shop.example.com. Your hosting stays as it is, there is no account, and apiton never holds a key of yours.

This article explains how it works, the steps on the page, the price and what the service cannot do.

Who it is for

  • You have a website on the ordinary web, served over https.
  • You own a .ton domain in your wallet.
  • You want the domain to open that website in TON browsers and TON proxies without running a TON server yourself: a program such as TON's rldp-http-proxy on a machine with a public UDP port, its own ADNL key and uptime you look after.
  • The site is mostly static: a business card, documentation, a landing page, a blog. The reasons are in the limitations below.

How it works

A .ton domain is an NFT in TON DNS. One of its records, site, says where the domain's website lives: the ADNL address of a server reached over the TON network, or a TON Storage bag. The details are in How TON DNS and TON Sites work.

apiton runs a customer node: one ADNL server, built on the same server software that serves apiton.org as the TON Site apiton.ton. Your domain's site record points at that node's ADNL id. A visit then goes like this:

  1. The visitor's TON proxy or TON browser reads the site record of shop.ton from the blockchain and gets the node's ADNL id.
  2. It finds the node through the TON network's DHT and sends the HTTP request over RLDP, with shop.ton as the host.
  3. The node looks up which website belongs to shop.ton, requests the same path from https://shop.example.com (https only, the certificate is verified) and sends the answer back the same way.

Every customer's record holds the same ADNL id: the node tells the domains apart by the host name. So the record alone does not say whose order a domain belongs to. The payment does: the first one must come from the wallet that owns the domain.

Visitors can open the site in three ways (see How to open a TON Site):

  • with a TON proxy on their computer, such as Tonutils Proxy, at http://shop.ton/;
  • in a wallet or browser with a TON proxy built in;
  • in any browser, once apiton's regular check of TON Sites has found the site live: it is then listed in Live TON Sites like any other, and its View button opens it through apiton's gateway at https://shop.ton.direct/.

The steps

  1. Connect the wallet that holds the domain. On Your website on .ton, press Connect wallet and connect it with TON Connect. The form lists the wallet's .ton domains; pick yours, or type it if it is not listed. Nothing is sent from the wallet yet, and the form also works without connecting one.
  2. Enter the website and check the pair. Enter the address of the site itself (https, no path) and press Check. apiton says whether the pair can be served and, if not, why: the address is not https, the domain is on sale or expired, a name looks like a wallet or an exchange. With a wallet connected, it also says whether that wallet owns the domain. Nothing is written yet.
  3. Make the order. apiton now asks for your home page the way its node will: it must open over https, answer with a web page, not redirect to another host and not be held up by a Cloudflare challenge. There is no file to upload and no DNS record to add. The next page shows the manage secret once — you need it to stop the order; apiton keeps only its hash. If the website does not pass, the order page says why in plain words and Check now runs the check again.
  4. Pay from the wallet that owns the domain. The pay page opens right after the order, with the wallet still connected. With TON Connect it is one transaction of two messages: the payment, with the order's comment, and a record change that points the domain's site record at apiton's node. About 0.05 GRAM of the second message stays on the domain and renews it for a year. A wallet that signs one message at a time sends two transactions instead. Without TON Connect, pay by the ton:// link or the QR code on the same page and set the record on dns.ton.org to the ADNL id shown there. A payment from an exchange will not do: it does not come from the domain's owner.
  5. Live. Once the payment and the record are on the chain, the site opens at http://shop.ton/. If the domain had a site record pointing elsewhere, its previous site stops opening.

The order's page has a link that subscribes a chat to the order in @apitonBot: the bot writes when the site goes live, when a check fails and before the paid period ends. The same steps with every detail of the website check are in the guide Put your website on your .ton domain.

Price and period

  • 1 GRAM (1 💎) buys 30 days. GRAM is the coin of TON, formerly Toncoin.
  • Renewals add to the time left and may come from any wallet; only the first payment must come from the domain's owner. One payment can cover several periods at once.
  • After the paid period the site is still served for a short grace period, then it stops. The landing shows how long.
  • Refunds: none after the site is live, including when it is stopped for breaking the rules. Before it is live, a refund to the paying wallet on request.
  • Limits per site on requests, response size and traffic per period. Above them visitors get an error. The current values are on the landing.

What it cannot do

  • Only GET and HEAD requests are relayed. Forms that send data, logins, carts and anything else built on POST do not work.
  • https only. The website must be served over https on its own host name.
  • Links and requests that JavaScript builds while the page runs are not changed. An absolute link to your website's own address can take the visitor out to the ordinary web. Prefer relative links (/about/, not https://shop.example.com/about/).
  • Resources from other hosts — scripts, fonts, pictures — load only when the visitor's TON browser can reach the ordinary web.
  • A website behind a Cloudflare challenge or a firewall that blocks apiton's server cannot be served. The node fetches every page from one address, and visitors would get the challenge page instead of yours. Allow that address and keep challenges away from it, as described in your website behind Cloudflare.
  • Restricted content is refused. Sites about drugs, weapons, gambling, adult content, fraud, phishing, piracy and anything else the terms forbid are not served, and a live one is stopped.
  • No uptime guarantee.

The What it cannot do list on the landing has the current details.

What apiton checks and keeps

  • Before the payment: that the website works through the node — https, a web page, no redirect to another host, no Cloudflare challenge — and that its home page does not break the rules.
  • While the order runs: the same website check every day (three failures in a row pause the site until a check passes again); the domain's site record, its owner and its expiry every few hours. A record that points elsewhere or an expired domain pauses the site. A domain that is sold or transferred ends the order: the new owner makes an order of their own.
  • Like every TON Site, a served domain is checked by apiton's regular probe and can be taken down by a report: takedown requests.
  • What is stored: the order, the results of its checks and per-site counts of requests and traffic. The node does not log the address of the visitor's TON proxy or gateway and does not pass it on to your website.

To start, enter your website and domain on Your website on .ton and read the terms. To check a domain's owner, expiry and TON Site in Telegram, send its name to @apitonBot.

Try it in @apitonBotfree: look up, watch and get alerts in Telegram

Explore the catalog

More from the blog

All articles · RSS

Search

Open in @apitonBot