motivation

Started as a toy project to learn more about both Rust and Kaspa/cryptocurrencies.

Kaspa was fertile ground for building things that already exist in other networks so I figured it could be interesting both learning and to be the first one for building something (somewhat) useful. *insert GLORY! emoji here*

how

Basically it's just a service that runs on fly.io --back in the old days when it was free 🤑-- , and subscribes to the block-updates socket.io channel which is generously exposed via official REST API of Kaspa.

For every new block, we go over all the transactions in search for exceptionally large amounts. If found any, the service tweets about it with some of it's metadata.

There is no official definition of "exceptionally large" so I count it as a a fraction of the total supply, usually around 0.1% (mentioning a $ amount here is useless...).

At first the alerts only included the raw kaspa amount, later on I added a conversion to USD$.

a small lesson about UTXOs

At some point, I realised there were too many alerts, like a few every day. The reason was that wallets sometime aggregate many small UTXOs into a large one, but effectively Mr Whale here didn't move the money to someone else. So I had to filter transactions in which the payer address and payee address are the same, sounds trivial, but in UTXO-based blockchains the payer address is not specifically mentioned - it's just a UTXO, the payer is just another transaction, so I had to query for the earlier transaction's payee address.

another cool idea with horrible implementation 🤭

I got requests from some Kaspa fans to extend the alerts with whether a whale transaction came from an exchange or not, and if so from which one.

To do that I had to store somewhere a map of addresses and exchange names. Usually you'll need a database for it, and update it when new exchanges list Kaspa or change wallets. Then to track those changes, maybe using dummy accounts in each of the exchanges. But I'm a simple man 😅 I just hardcoded a copy of a list I saw somewhere.