3

I am having a scenario where my chain is responsible for keeping records of airdrop accounts. Initially, all accounts have a zero balance. When I receive a list of accounts with the respective balances that need to be credited, I need to import this data to my runtime in an efficient way.

My question is: How can I efficiently import this data into the chain runtime? Is there a process that allows this to be done in one go?

1 Answer 1

1

You should not store the list of all the airdrop eligible accounts on chain. Instead you should put all these accounts in a merkle tree (the best would be a binary merkle tree) and then only put the root of this tree on chain.

When claiming the airdrop, a proof that the account is part of the initial tree should be included. This way you only need to store 32bytes on chain, instead of the entire list of eligible accounts.

Here is a pr that tries to achieve this for the assets pallet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.