Project Name: Tron SEA
Project Track: DeFi
Team Name: USTX Team
Team Member(s): 3, Sirluke, Benna, Aska
DevPost Project Link: Tron SEA on Devpost
Project Goal: Tron SEA is a framework for developers trying to simplify and make more affordable handling large airdrop or rewarding campaign. The TRX price increase over the last months and the high energy demand driving the rental prices high had the consequence of rendering very expensive sending tokens to many users. Tron SEA provides the building blocks to integrate Merkle tree distribution strategy into any Tron based project, greatly reducing the complexity and the cost on the builder by requiring user involvement in the claim action.
Project Value: Merkle tree algorithms are widely used in the blockchain industry, especially in the blockchain with higher TX fees. Sending tokens to hundreds or thousands of addresses is very expensive, also on Tron because of the fees increase over the last months. New projects, with little financial backing cannot currently afford such a campaign. but Tron SEA will be an enabling technology, made available for all builders, as open source and free code. Currently there is not an easy to use implementation of Merkle trees in Tron blockchain.
Project Info: Pitchdeck
Project Website: Github,Tron SEA website
Project Test Instructions: Tron SEA project is divided into 2 sections, the on-chain contract handling the verification of the proof and distribution of tokens and a php part to be integrated in the backend of the target application. The php generates the Merkle tree and creates the proof for each user to claim the airdrop.
Merkle trees need a predefined list of “leaves”, in this case a list of user/amount pairs has been created:
[ {"user":"TJHYbk7q2EuMJJZeEF6cxPBEDg9kG1sR1j","amount":"100000000"}, {"user":"TRc7JCUtMopM3sADYDj5KUBhzD1K3q1JsR","amount":"200000000"}, {"user":"TGpSjS9wg4tJRVv69bnCJCq9mGAmkMaSFC","amount":"300000000"}, {"user":"TLx5zMUwqcTu9iUmqpZsFMCRnNA2c1cAxt","amount":"400000000"}, {"user":"TJriuKLDcDjHrKUZvaoQvX84zLT2vy5GJv","amount":"500000000"}, {"user":"TAPobz7nvpNBJcqwv6zenuSGwscd47ToaN","amount":"500000000"}, {"user":"TKWmf2LbTjS4esYd1XfbZi5FWsZfrAphPX","amount":"600000000"} ]
To get the hashed tree for the list everyone can call the mTree.php like:
To get the proof for a specific pair call the mProof.php service, passing the user and amount parameters, like:
sea.ustx.io/php/mProof.php?user=TGpSjS9wg4tJRVv69bnCJCq9mGAmkMaSFC&amount=300000000
The script returns a json with proof and root, to be used to claim the reward from the contract using the claim or verify function on Tronscan
Project Details:
Inspiration
The TRX price increase over the last months and the high energy demand had the consequence of rendering very expensive sending tokens to many users. Small community projects without large resource backing do not have the capability to make large token distribution campaigns.
What it does
Tron SEA is a framework for developers trying to simplify and make more affordable handling large airdrop or rewarding campaign. Tron SEA provides the building blocks to integrate Merkle tree distribution strategy into any Tron based project, greatly reducing the complexity and the cost on the builder by requiring user involvement in the claim action.
Merkle trees were invented in 1979 by Ralph Merkle. The tree is a mathematical way to link all the leaves, to the tree top, the root. This allows to efficiently determine if a particular leaf belongs to a specific tree, using only a subset of all the information contained in the tree, the so called “proof”. Once a leaf has been validated to be belonging to the tree, a specific action can be executed safely.
In the blockchain field, the most common use of Merkle trees is to distribute rewards or airdrops (e.g. in Tron it’s used to distribute JustLend rewards) to a large number of users, without actually doing the transfer. The users have to take action directly (paying the TX fees) to claim the tokens, interacting with a smart contract that, together with the Merkle proof, ensures that only allowed users are claiming the correct amount of tokens.
How we built it
Tron SEA is build on Tron using Solidity using TronIDE as deployment platform. The backend is written in php and uses the IEXBase TronAPI library.
Challenges we ran into
There are several Merkle tree code bases available on the web, but none specifically targeted to Tron blockchain and using php as the backend language. We made the effort of handling Tron specific address coding and creating from scratch the Merkle tree creation and proof generation algorithms in php.
Accomplishments that we’re proud of
Merkle tree generation and proof creation work as expected, likewise the smart contracts deployed on chain.
What we learned
Even if some code technique is known and somewhat explained in literature, putting together a working product still requires time and effort to solve all the integration issues that always arise.
What’s next for Tron SEA - Safe and Efficient Airdrops framework
After mainnet deployment we’ll create a real rewarding campaign airdropping a selcted Tron OG community token to users willing to participate in a real world demo of the Tron SEA framework.
Smart Contract links: Tron SEA Nile contract
Project Milestones:
- October 8th - Deployment of MVP, consisting in php code to generate tree and Nile contract to verify Merkle proof [DONE!]
- December 3rd - Mainnet deployment and public airdrop campaign of a selected Tron OG community token