Technology Overview (ERC20 & NFT Linkdrop)

Mikhail Dobrokhvalov
Volcà
Published in
4 min readNov 4, 2018

Linkdrop is an airdrop, where instead of sending tokens directly to Ethereum addresses, deployer generates a list of ‘claim links’. Learn more

High-level Process Overview

Let’s assume Alice wants to linkdrop some tokens to friends. In order to do it, she needs to:

  1. Deploy a Linkdrop Contract;
  2. Generate claim links;
  3. Send links to friends;
  4. Then one of Alice’s friends (Bob) can follow the link and claim the tokens.

Process Details

Let’s dive in how it works under the hood:

1. Contract Deployment

Alice loads Volca’s web app. Then she chooses params of a token linkdrop and deploys a Linkdrop Smart Contract. (See How to Deploy’s post.)

Volca’s web app generates a new key pair which is used for link generation. Let’s call this key pair as Linkdrop Verification Key Pair. The public key is attached to the contract, while the private key is kept secret by Alice and used later to generate links.

2. Link generation

After the contract is deployed, Alice’s device generates a bunch of links. (Note: Volca’s server never sees the Linkdrop Verification Key and the links.)

  1. For each claim link Alice’s device generates a unique Link Key*.
  2. Alice’s device signs the link private key with the Linkdrop Verification Key. This step is needed so that the Linkdrop Smart Contract is able to verify that the link’s ephemeral private key was authorized by Alice.
  3. Alice’s device constructs a link which includes Link Key* and the signature from Step 2.
// link_key - unique link private key
// sig - signature, which is generated by the Linkdrop Verification // private key signing link_key
const link = `http://volca.app/receive?pk=${link_key}&sig=${sig}`

3. Link distribution

Link distribution is out of the scope of Volca’s Linkdrop solution. Alice can distribute links in any way she finds suitable: in-person, via email, chat messenger, phone number, etc.

For our case, let’s assume Alice sent a link to Bob using Telegram messenger.

4. Claiming link

Here is how Bob’s user flow looks like

In order to claim tokens, Bob follows the link on his mobile phone. As Bob doesn’t have a wallet, he is prompted to download and install Trust Wallet on his device. After the installation Bob generates a new account in the app. Then he is automatically redirected to the claiming page.

On the claiming page, Bob’s device parses the link to get the link’s Link Key* and uses this private key to sign Bob’s address.

After that, Bob’s device sends his address and 2 signatures to Volca’s server:

  • One signature to verify that the link’s Link Key* is authorized by Alice
  • Another signature is to verify that Bob’s address is signed by the link’s Link Key*

The Server calls Smart Contract which verifies the signatures and that the link wasn’t claimed before. If everything is correct, the contract distributes the tokens from Alice’s account to Bob.

*Link Key — a unique Ephemeral Private Key generated per each Claim Link.

Architecture

Volcà Web App

  • Deploys a Linkdrop Smart Contract for the linkdrop
  • Generates claim links (as a CSV file)
  • Allows receiver to claim tokens

The deployment and interaction with the Linkdrop Smart Contract and the Relaying Server are handled by the volca-airdrop-core library on GitHub.

Linkdrop Contract

  • Distributes tokens from Linkdropper’s Ethereum Account
  • The receiver gets tokens and Ether after following a claim link
  • Linkdrop Contract is deployed for each linkdrop

The Smart Contract’s code can be found on GitHub.

Volcà Relaying Server

Volca’s server which calls Smart Contract on behalf of the receiver. Volca pays for gas instead of the receiver.

--

--