Verify user uniqueness for airdrops

If you want to have a fair airdrop or just make sure that your drop is really distributed to real people and not bots, with our easy to use interface you can make sure that you have a fair airdrop to your users. You can integrate with zkportal through the following steps:

Step 1. Request authentication token and appId

Request an authentication token and appid via mail.

Step 2. Integrate claim check into your app

When a user wants to claim an airdrop, you should in turn register the claim with zkPortal by sending a POST request to https://backend.zkportal.io/airdrop/claim. The response may be:

  • 201: the airdrop claim has been registered succesfully
  • 204: the airdrop claim was registered already in the past
  • 400: bad request
  • 401: unauthorized
  • 404: no user could be found which wants to link their identity with this airdrop
  • 500: internal server error

Two code examples follow below:

curl example
ZKPORTAL_APPID=<your app id from step 1>
ZKPORTAL_TOKEN=<your authentication token from step 1>
ZKPORTAL_AIRDROPID=<a unique id referencing your airdrop>
ZKPORTAL_USERACCOUNT=<user ethereum account>
curl https://backend.zkportal.io/airdrop/claim -d '{"appid": ${ZKPORTAL_APPID}, "airdropid": ${ZKPORTAL_AIRDROPID}", account": ${ZKPORTAL_USERACCOUNT}' -H "Authorization: Bearer ${ZKPORTAL_TOKEN}>"

node example
const https = require("https");
const ZKPORTAL_APPID="your app id from step 1";
const ZKPORTAL_TOKEN="your authentication token from step 1"
const ZKPORTAL_AIRDROPID="a unique id referencing your airdrop"
const ZKPORTAL_USERACCOUNT="user ethereum account";
const postData = JSON.stringify({
  "appid": ZKPORTAL_APPID,
  "account": ZKPORTAL_USERACCOUNT
});
const options = {
  hostname: "backend.zkportal.io",
  path: "/airdrop/claim",
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Content-Length": Buffer.byteLength(postData),
    "Authorization": "Bearer " + ZKPORTAL_TOKEN
  }
};
const req = https.request(options, (res) => {
  console.log(`STATUS: ${res.statusCode}`);
  res.setEncoding("utf8");
  res.on("data", (chunk) => {
    console.log(`BODY: ${chunk}`);
  });
});

req.on("error", (e) => {
  console.error(`problem with request: ${e.message}`);
});
req.write(postData);
req.end();

Step 3. Ask your users to prove their identity using zkPortal

All that is left, is for your users to prove their uniqueness, you can point them to the instructions here!