Add Kaspa to your exchange
This tutorial describes how to add Kaspa's native currency KAS to your cryptocurrency exchange.
This tutorial uses
Firstly you need a synchronized node for interacting with network, you can use a public node but it wont be reliable such as your private node.
Create an unique address for every depositer using kaspawalletd's
We suggest moving some fund of hot wallets to cold wallets for extra security.
Firstly, subscribe for
Secondly, cache block contents comes from
notifyBlockAddedRequestand filter&cache deposit transactions from block.
If acceptedTransactionIds includes any pending deposit, save acceptingBlockHash for transaction.
If any pending deposit included on removed blocks, remove acceptingBlockHash from transaction.
Get virtual parent by
addedChainBlockHashes's last entry and get blue score of virtual parent by fetching block's contents from block cache, a pending deposits confirmations will be
blue score - deposit's acceptingBlock's blue score + 1
Finally, when the confirmations of a deposit transaction reaches 1200, it is safe to believe the deposit is complete.
Sendfunction with amount & address.
Dont forget to check address before using send function, it could crash kaspawalletd!
GitHub - svarogg/kaspadotnet: Some examples on how to use the kaspa APIs under dotnet
Includes examples for listening transactions & interacting with kaspawalletd.