0

I'm working on a TG bot used for exchange of crypto <-> fiat.

Each customer gets assigned a single wallet, once, which he is to send coins to, however he wants to, priour to receiving fiat. Namely, telegram_user_id -> one_wallet. The same wallet then gets used by a user for all future transactions

A bot, on the other hands, is supposed to identify whether or not a wallet has been topped up for a certain deal or trade. Once topped up, an operator gets notified and gives fiat to a customer.

Issue: how to identify if a certain incoming transaction corresponds to a particular trade?

Namely:

  • A customer could, theoretically, open a deal and abandon it.

  • A customer could also open 5 subsequent deals, abandon first 4, and then proceed only with the latest one -- send coins to a wallet.

  • A customer could open a deal, send coins, receive fiat and then open a new deal for the same amount right away.

  • And I can't force a customer to attach a special deal ID to a transfer because not all the wallets, nor even blockchains, support this.

  • The sum of a deal may not be used because it's not unique.

How would a bot identify which transaction on blockchain, in a wallet, belongs to which deal of a user? And whether there's even been any transaction for the current deal at all?


Note that it works the way I've described - in Telegram. There're no smart contracts, nor web3 wallets on a website, and this is a requirement.

1 Answer 1

0

Each customer is assigned a wallets

Issue: how to identify if a certain incoming transaction corresponds to a particular trade?

Suggested solution

Each trade gets assigned a wallet.

See how Coinbase is using CREATE2 opcode: https://www.coindesk.com/markets/2019/08/14/coinbase-is-using-an-ethereum-upgrade-to-help-merchants-accept-usdc/

“[With CREATE2] I can show you an address that doesn’t exist on the blockchain but that you can pay to.”


There're no smart contracts, nor web3 wallets on a website, and this is a requirement.

At some point, somewhere, somehow, you need to create wallets for the users. You may as well create wallets for transactions.

Cost of creating a wallet = $0.

Cost of sweeping the wallet to the destination = gas fee only.

6
  • I have no idea how this is supposed to be a solution. [With CREATE2] I can show you an address that doesn’t exist on the blockchain but that you can pay to. --> every possible address in Ethereum already exists on blockchain, whether it may have been explicitly generated by someone, or not
    – Kum
    Dec 23, 2022 at 21:44
  • Once again: in my TG bot, each user get an address ONCE, and PRIOUR to a creating deal. Not each single time a user makes a deal, but once. A wallet then gets used by a user for all future transactions
    – Kum
    Dec 23, 2022 at 21:45
  • Then my answer will be "I don't know". You may or may not ignore the suggestion of creating the address per transaction, not per user. Dec 25, 2022 at 13:07
  • My comment will be "you don't know what you're talking about".
    – Kum
    Dec 25, 2022 at 15:38
  • I wish I could downvote myself. Not possible though. My assumption is that your goal is to have a working product, happy customers, charge small fee here or there, make profit, be happy, accomplish self-actualisation (top of the hierarchy of needs). One option is to stick to your requirements (my answer "I don't know") or just change the requirements slightly... MAYBE Dec 27, 2022 at 16:47

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.