Token distribution

How can I do this simply and efficiently?

Is there any way to list in a spreadsheet all the wallets that sent some amount to my wallet?

I want to carry out a token distribution, but I don’t know how to identify everyone who sent some amount to my wallet without looking 1 by 1 at https://cardanoscan.io/.

Are there any guides for this?

If you don’t want to click through, you’d need some programming using an API like Koios https://www.koios.rest/guide/ or Blockfrost https://blockfrost.dev/ to query the transactions going into your address.

You could also use something like Kupo https://cardanosolutions.github.io/kupo/ or even only Ogmios https://ogmios.dev/ running on top of one of your own nodes, where Ogmios is only a very thin layer above the node. But that could already be enough: You perhaps do not need the whole history of your address, just the unspent transactions outputs on it, if you spend them in exactly the transaction that sends back the tokens to the user.

The more modern way to distribute tokens would be a dApp, though, a website where the users connect their wallets and you build a transaction where they pay and get the tokens at the same time, so that they do not have to trust you that you will manage to do the transaction back to them.

That would use CIP-30 https://cips.cardano.org/cip/CIP-0030 to connect to the wallet. There are libraries like Mesh https://meshjs.dev/guides or Lucid https://lucid.spacebudz.io/ to help with that.

1 Like

Which of these would you recommend I try first?

Thanks for the answer.

Hard to tell without knowing more.

Do you already know some programming? Which languages?

What do you want to do exactly? Do you have a team?

What infrastructure do you already have, anyway?

How much do you want to learn for this?

1 Like

Man It’s just me. I worked with JavaScript more than 10 years ago, and I’m currently trying to learn Python, but I’m still at the basics.
I like learning step by step.
What I want to learn now is:

  1. How to check which wallets (address and stake wallet) sent some amount to my wallet.
  2. Make it a .cvs spreadsheet
  3. How to use this to perform a return transaction, returning the amount sent to me in tokens to whoever purchased.

I know it’s a lot to learn, so any help/tips are welcome.

I started trying with Blockfrost, trying to do something like this:

curl -H “project_id: YOUR_API_KEY” https://cardano-mainnet.blockfrost.io/api/v0/addresses/YOUR_ADDRESS/transactions | jq -r ‘. | {tx_hash: .tx_hash, inputs: [.inputs | {address: .address, amount: .amount}]}’ > transactions.json

jq -r ‘. | [.tx_hash, (.inputs?.address), (.inputs?.amount)] | @csv’ transactions.json > transactions.csv

= [+] without “+”

But I think I’m writing the command wrong.