Skip to main content
Cardano NFT-marketplace

The First NFT-marketplace on Cardano

5 people
in the team
5 month
of work

Designed and developed in collaboration with IOHK, a decentralized application on the Plutus platform. The created DApp is one of the first NFT marketplaces on Cardano.

See the case

TON Payments: how users can send micro-payments without fees and where to use this technology

payments

If blockchain users conduct micro-payments that are not recorded on the blockchain itself, they become free and unrestricted in speed. Read about how TON developers achieved this, how secure such transactions are, and why to use TON Payments in online games and offline.

To get the main points on the topic in 30 seconds, skip directly to the "In Briefly" section.

About TON (The Open Network)

The TON network was conceived by Pavel and Nikolai Durov in 2018 to create an ecosystem based on the Telegram messenger with its own blockchain, payment system, and other services.

The main difference between the TON blockchain and others is the speed of transactions they aim for and scalability. The ability to quickly scale the network without sacrificing performance and while maintaining availability for millions of users worldwide is enabled by sharding. We've already discussed what this technology is, when it appeared, and how sharding works in TON.

If you want to learn more about TON, its advantages, and algorithms, read this material.

About TON Payments

TON Payments is a payment processing system within the TON ecosystem that allows users to send cryptocurrency to other users, make payments to Telegram bots, applications, and other services.

At the core of TON Payments are State Channels and Payment Channels technologies.

State Channels. State Channels technology allows users to exchange a multitude of data without prior recording of these processes in the blockchain. In other words, most processes occur off the blockchain: it only records the most essential information. As a result, the load on the blockchain is minimal, as is the fee for blockchain usage for users.

State Channels technology is not new. It is used not only in TON but also in many other places. For example, on the popular NFT marketplace OpenSea. One version of smart contracts on OpenSea stores not the entire set of data but only their hash. Thanks to this, at the moment of completing the transaction, the system only verifies the hash - this is cheaper for users than if the blockchain were processing the data itself.

Payment Channels. A specific case of State Channels is Payment Channels. This technology allows for numerous micro-payments between users without a fee for each transaction. Users only pay for opening and closing the channel. Additionally, transaction processing does not require users to wait the typical five seconds needed by the blockchain; transactions are executed instantly.

For example, Tony and Steven opened a payment channel and transferred cryptocurrency to each other for a month. When the users close the channel, the blockchain will consolidate all actions within that channel into a single transaction. As a result, Steven and Tony will pay a small fee for all payments. The size of this fee is independent of the number of payments.

One of the main advantages of Payment Channels is privacy. Transaction data between users is stored within the payment channel and is only known to its participants, whereas in a traditional blockchain, such as Ethereum, each action is recorded in a public ledger.

Important: TON developers are advancing the technology of payment channels. Soon, TON Payment Channels will be succeeded by the Pre-TON Payment Network. Users will be able to establish a payment channel through an intermediary node and exchange payments without creating new channels each time.

The final stage of developing the concept of micro-payments in TON is the TON Payment Network. At that point, there will be numerous intermediary nodes in the network, and each user will be able to create their own to receive a commission for transfers through it.

Other blockchains and payment systems also use Payment Channels technology. For example, Bitcoin has the Lightning Network, which is a network of payment channels between users. The solution also has open-source code, just like TON. Additionally, payment channels are available with Visa: the Universal Payment Channel simplifies operations with digital assets.

Nikolay Bordunenko
MetaLamp project manager

How TON Payments work

Let's explore how TON Payments work using an example.

Let's say Bob and Alice realize that over the next few weeks, they will need to make many micropayments to each other—they will be transferring coins back and forth. Instead of using a regular blockchain and paying for each transaction, the two decide to use TON and its TON Payments. For this, users must first open a payment channel, perform the necessary operations within it, and then close the channel. Here's how it all works.

Opening a Payment Channel. To open a payment channel, participants deposit a fixed amount, let's say 100 TON. They can then transfer coins to each other within this amount.

The deposit also acts as collateral, ensuring that each user will act honestly. If one participant tries to cheat the other during the coin exchange, according to the smart contract terms, they will lose part of the deposit.

Bob and Alice confirm their intention to open the channel by signing a smart contract with unique private keys. Such a key is equivalent to an electronic signature used to sign documents electronically, such as on government portals.

Once the users have signed the smart contract, information about the payment channel is recorded on the blockchain, and the channel is considered open, with participants paying a small fee.

Using the Payment Channel. Suppose Bob wants to transfer 5 TON to Alice. He creates a transaction for this amount, meaning a message that he wants to transfer 5 TON to Alice, and sends this message to the channel with Alice.

If Alice agrees, she accepts this message. After that, the participants' balances change: Bob's balance is blocked by 5 TON, while Alice's balance increases by 5 TON.

Each transaction has a unique identifier and contains information about the previous channel state, information about the new channel state, and a trigger that initiates the channel transition from one state to another.

As long as the participants agree to change the channel's state, transactions occur between them. Payment information is stored within the channel and is not reflected in the blockchain.

Closing the Payment Channel. Bob and Alice have finished transferring coins to each other: Bob now has 130 coins, and Alice has 70 coins. It's time to close the payment channel, meaning to submit the final and mutually agreed-upon channel state to the blockchain.

Users confirm that they agree with each other's transactions and sign the smart contract. After that, the system distributes the coins between Bob and Alice based on all payments, records the channel closure in the blockchain, and the participants pay the fee again.

To transfer cryptocurrency to each other again, Bob and Alice must open a new payment channel.

If something goes wrong. Sometimes users cheat. For example, one participant may initiate channel closure by sending a non-final state and underpaying a significant amount.

If Bob tries to cheat Alice, she can independently close the channel to receive all the coins due to her. To do this, Alice will need to prove that Bob attempted to cheat her and provide a later channel state as evidence. The smart contract ensures that the coins in the channel will be distributed fairly.

Where TON Payments can be used

TON Payments are intended for use in various fields, from online gaming to offline transactions. Here are the main scenarios for using this technology.

DeFi Projects. One of the obvious use cases for TON Payments is settlements in projects within the crypto universe. For example, a non-custodial cryptocurrency wallet in a Telegram bot that incorporates TON Payments.

Online Gaming. TON Payments are suitable for paying for various in-game purchases such as player upgrades, equipment purchases, ammunition, skins, accessories, and sending donations to developers, and more.

Streaming. Users can support their favorite bloggers, musicians, artists, and other media personalities by paying for access to content using TON Payments.

Social Network. TON Payments are one way to monetize content, allowing users to charge for viewing photos, likes, saves, and other actions.

Developer Services. Companies offering specialized solutions for programmers, such as API access or integration with banking services, can utilize TON Payments.

Service Industry. TON payment channels are suitable for paying for various services whose cost depends on the time the buyer has used the service, such as car rentals, gadget charging, cleaning, and more.

Offline. TON Payments provide an alternative to traditional payment methods like credit cards and QR code payments. For example, by opening a payment channel, one can quickly pay for food purchases on a plane or coffee at a favorite café.

Currently, Payment Channels are a concept. There is a working module, but it is not ready for mass adoption yet because it lacks an element called the Payment Network. This element is a router that is needed to allow users to use payment channels not only online but also offline. Due to this limitation, the technology is not yet very popular.

Project ideas with TON Payments

In 2022, the TON Foundation team, which develops the TON ecosystem, held the first Hack-a-TON in support of TON Payments technology. Within 48 hours, participants came up with and developed prototypes for over 80 services that utilize Payment Channels. Here are the top five most promising projects.

OnlyTONs. Developers came up with a social network where content creators receive rewards in the form of micropayments for views of their photos.

Artists, models, and other media personalities upload photos, and instead of paying a monthly subscription for access to media, subscribers select the photos they need and pay only for them.

To start using the platform, a user opens a deposit in the payment channel. For each photo view, the system records a micropayment and collects signatures. When the user finishes consuming the content, the payment channel automatically closes, and the content owner receives a reward.

OnlyTONs prototype and video how it works.

The creators of the social network OnlyTONs came up with a way to automate payments of rewards to media personalities for views of their photos. Source: github.com

OnlyGrams is another social network based on TON Payments microtransactions, where content creators receive rewards for actions by other users.

Unlike regular websites where users either donate a significant amount to support someone or view content for free, the amount of microtransactions in OnlyGrams depends on the user's interaction. For instance, each post view costs 0.0001 TON, while reactions to posts cost 0.01 TON for "Like" and 0.1 TON for "Fire".

OnlyGrams prototype and video how it works.

To start using the OnlyGrams social network, a user simply needs to deposit an amount ranging from 0.1 TON to 10 TON and wait for 15 seconds. Source: onlygrams.io

TON API. The authors of this project devised a solution to address the issue of low performance of public nodes, known as "nodes" in blockchain terminology. This solution is intended for developers of various services.

For instance, there's a restriction for the TON test network — only one request per second is allowed. To circumvent this, one needs to deploy their own node, which may not always be feasible. Instead, participants of the Hack-a-TON propose that developers use private nodes with paid access. Through a payment channel, the user pays for each request they send to the node.

Video about TON API.

As an interface for registration and payment, the TON API solution utilizes a Telegram bot, and for opening payment channels and storing data, a backend JS server is used. Source: youtube.com

Rock-paper-scissors game. Developers demonstrated how TON Payments can be used in any PvP game where one or more users compete against each other.

For example, users who decide to play a game familiar to everyone from childhood make a deposit and open a payment channel between themselves. Afterward, they place bets, play, and in the end, the winner takes the prize in the form of a monetary reward.

Video about Rock, Paper, Scissors Game.

Payment Channels allow users to play PvP games as much as they want without paying network fees. Source: youtube.com

Diamonds. The project authors suggest using TON Payments to pay for video lessons on educational platforms. Thanks to the payment channel, the user only pays for the time spent with the teacher.

For example, the standard duration of an online lesson is one hour. But the teacher was only able to spend 15 minutes with the student because urgent matters came up. On the Diamonds platform, the student opens a payment channel that closes at the end of the lesson. This way, the student pays the teacher only for the actual time of online learning.

The developers of Diamonds have come up with how payment channels can save users money during online learning in various disciplines. Source: youtube.com

Diamonds prototype.

Video about how Diamonds works.

Briefly

  • TON Payments is a payment processing system within the TON ecosystem, allowing users to send cryptocurrency to each other, make payments to Telegram bots, applications, and other services.
  • At the core of TON Payments are technologies like State Channels and Payment Channels.
  • With State Channels, most data exchange processes between users occur off-chain, with only essential information recorded on the blockchain.
  • Thanks to State Channels, the blockchain's load is minimal, as is the fee users pay for its use.
  • Payment Channels are a specific instance of State Channels.
  • Within Payment Channels, users only pay for the opening and closing of the payment channel, where all transactions between participants occur.
  • With Payment Channels, users don't have to wait for the usual five seconds it takes for the blockchain to process a corresponding block; transactions happen instantly.
  • TON Payments can be used in DeFi projects, online games, streaming platforms, social networks, developer services, service industries, and offline scenarios.
  • The most interesting and promising project ideas with TON Payments were presented at the Hack-a-TON event in support of TON Payments technology, which took place in 2022.
l2
New
stacking_nft
New
NFT Staking: How does It work?

Pavel Naydanov

Solidity developer

Articles

ethereum
web3
dApps
legendary_play
New
payments
New
TON
sharding
Featured story
blockchain_top_companies
mvp_2024
launchpad
How to create a launchpad?

Nico Bordunenko

Project manager at MetaLamp

Articles

web3
dApps
launchpad
aa zkp
Featured story
zksync
Featured story
rwa
Featured story
anonymus
Featured story
Zero-knowledge proof explained and 2024 Trends

Yevgeniy Biktimirov

Venture Analyst

Articles

ethereum
web3
dApps
cpay
Featured story
stock market chart
Featured story
planets
fundraising
Featured story
cto
wallet
Account Abstraction: A Tool Against Gas Fees in Your dApp

Nico Bordunenko

Project manager at MetaLamp

Articles

ethereum
web3
tokens
Featured story
rocketcomputer
Featured story
How to create a design for a startup MVP in 7 days

Julia Cherepanova

Head of Design Office

Articles

startup
MVP
design
crypto wallets
Featured story
speed up development
myths
Featured story
Myths about Blockchain Product Development

Nico Bordunenko

Project manager at MetaLamp

Articles

web3
dApps
startup
mvp launching rocket
Featured story
Who should be hired on the team to launch an MVP?

Alexey Sukharev

HEAD OF Sales DEPARTMENT

Articles

business
startup
MVP
galaxy
Featured story
magazine
Top 6 Trends in Crypto Apps 2023

Roman Shtih

CEO Metalamp

Articles

web3
dApps
cryptocoffee
investments
investors
squares
The first NFT marketplace on Cardano

Stanislav Zhdanovich

Haskell developer

Articles

cardano
web3
NFT
stair
bridge
abstraction
How we use our own training program to hire Plutus engineers

Svetlana Dulceva

The Education Program Supervisor

Articles

education
cardano
web3
mountains
computer in space
A perfect HR: why are IT companies happy with our junior developers?

Svetlana Dulceva

The Education Program Supervisor

Articles

education
web2
business
salary
IT developer
cardano
chains
abstraction
salary
Featured story
rocket
a man with books
Featured story