Sending Assets (NFTs) to empty accounts

Greetings, I am trying to implement a script with the AlgoSDK that creates a lot of NFTs (a collection) as standard assets and I want to airdrop the assets to the accounts.

So

  • I created the main account on test net and funded it with some algos
  • I created an asset with an amount equal to 5 and decimals 0
  • Now I want to send these 5 assets to 5 different addresses

I create these accounts with the apposite SDK function but when I use the transferAsset function to send form address1 to one of the new created accounts, I get this error:

(node:10803) UnhandledPromiseRejectionWarning: {"message":"TransactionPool.Remember: transaction OBGW2J4KNZLWOJRWTFX6EX3GNA5NSK5YZNW727GBQM2R6ALM4NTA: overspend (account GXMR6Q2E33PMUCSYYMG5B7OZWTR54W4PSXUH455Y34E67UAIGKDJS4Q3JY, data {_struct:{} Status:Offline MicroAlgos:{Raw:0} RewardsBase:0 RewardedMicroAlgos:{Raw:0} VoteID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SelectionID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] VoteFirstValid:0 VoteLastValid:0 VoteKeyDilution:0 AssetParams:map[] Assets:map[] AuthAddr:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ AppLocalStates:map[] AppParams:map[] TotalAppSchema:{_struct:{} NumUint:0 NumByteSlice:0} TotalExtraAppPages:0}, tried to spend {1000})"}

I found out that, to receive an asset, an address must have at least 100,000 microAlgos.
It makes sense to prevent from fake data usage, but can be a limitation in case of airdrops, is this true?

What is the best solution to the problem?
Supposing to send 10k / 20k assets during an airdrop, is the best thing to do:

  • To fund each of the receiving addresses with 100,000 microAlgos
  • To opt int each of the accounts to receive the asset
  • Then to receive the asset

Is this correct?
Thanks in advance for the help.

Yes, the above is currently what you need, with the change that you need to fund receiving addresses with
201,000 microAlgos

  • 100,000 microAlgos for base min balance
  • 100,000 microAlgos for the ASA optin min balance
  • 1,000 microAlgos for the fee to optin

You can have smart signatures/smart contracts that remove requirement to sign some of these steps explicitly in some cases.