Token targeted airdrop

Karol Kowalski
userfeeds
Published in
5 min readMay 8, 2018

At Userfeeds we’re big fans of the decentralized concept, and we’ve created a few demo applications to show the immense capabilities of our own aggregated API. In this post we’re going to expand on our Cryptopurr concept, which is essentially Facebook for Cryptokitties. With Cryptopurr, you can use your kitty as your unique identity to share information across decentralized apps. You can write messages (called Purring), sign them, and post them across any ethereum blockchain. Any, we hear your cry? Absolutely: messages posted on ethereum test networks, such as Kovan, Rinkeby or Ropsten, are visible on a par with messages posted on mainnet. We included the ability to write on any chain in order to keep the cost to users to an absolute minimum.

Here you can read more about Cryptopurr and why sticking to mainnet is not always the best idea.

Why airdrop KETH?

We needed a way to get users on board with our Cryptopurr platform, and the best way to do that was to remove any potential barriers of entry. Since the biggest barrier for any dApp is the cost per interaction (whether it’s a post, a vote or a like), the most impactful solution was to hand out some free cryptocurrency. This has the added bonus of making the Cryptopurr user experience as seamless as possible.

Of course, if a user urgently needed to make their kitty purr with our app, they could request some test ethereum from one of the faucets (kovan gitter faucet). But we had a better idea. We could send Kovan ethereum (KETH) to all Cryptokitties owners so that anyone could write a message immediately, without the hassle of requesting it themselves. From the list of available test networks, we chose Kovan because of its speed. This proof-of-authority testnet has consistent speeds of one block per 4 seconds, so it was the perfect choice for a platform based on rapid interactions, which social networks are.

Cryptokitties owners list

At Userfeeds we deliver an aggregated API over ethereum blockchains. Among other things, we aggregate all ERC721 token transfers. Thanks to this, it was easy to retrieve all 72,000 addresses that owned at least one kitty. You can see a list of owners for yourself directly in json format here. You can check out the API yourself if you want to generate your own custom group of recipients.

Massive amount of KETH

Let’s start with a rough approximation of how much KETH we need for a targeted airdrop of this size. We want to provide KETH to 72,000 addresses, and we want to let each address post a lot; let’s say 100 times. Hopefully 100 user interactions will be more than enough for Cryptokitties owners to see the fun of the Cryptopurr platform, and then they can retrieve more KETH from a faucet of their choice. Since each message on Kovan can be sent with 1 gwei gas price, we get a cost per message of less than 0.0001 KETH, leading to a grand total of 720 KETH for the whole airdrop. This might not seem like much, but one does not simply walk into a faucet full of KETH. Fortunately for us, Parity was awesome enough to give us all the KETH we needed, so kudos to them.

How to send 72,000 transfers

All of us have been hit by a massive gas bill at least once, and for our airdrop the bill was potentially enormous. A simple transfer of ethereum costs 21,000 gas. Multiply that by our planned 72,000 transfers, and the total cost is a massive 1,512,000,000 gas. This exceeds the gas limit per block on kovan (8M) nearly 189 times over, so we have to break it down into batches. We also want all transactions to be easily connectable with our airdrop event, which is why we decided to create a contract. Besides transferring KETH, the contract also creates an event on a blockchain (check out our github on that). It all ran perfectly, and you can see the results of our airdrop on etherscan, consisting of 360 transactions in all. To send them we used our own small tool, which you can check out on github if you want to be equally generous to your own user base. We initially thought about using metamask, but that only supports up to 20 transactions (because obviously, who would ever need more than that?) and our needs were a little more demanding. To get around this, we switched to a Parity client, and by adding a--warp flag we were able to sync to Kovan in less than 5 minutes. Using the --unlock flag also meant that we didn’t have to approve all 360 transactions individually, so the whole airdrop only took 51 minutes to execute from its initial run.

New owners

Sending KETH to all current Cryptokitties owners is great to get people purring, but it doesn’t help to expand the number of active users. And if you haven’t got your own kitty yet, don’t panic. We’ve also built a service that monitors the ethereum blockchain for new Cryptokitties owners, and automatically sends a fixed amount of KETH to their address. That way, new users can start purring on our platform as soon as they get their kitty. We use our public API to manage it all, so if you want to play around with it yourself, you can find all the documentation here, plus an example from the Kotlin code here.

--

--