Is there a correct way to detect ADA payment from multiple users into single receive address?

Hi guys,

I am working on a store-like app where part of the functionality is hosted online (traditional full stack application) and I want the payment to my app to be made in ADA.

I assume this will be a trivial matter once we have smart contracts, but I want to go to market first with a hybrid solution first and upgrade when smart contracts are available.

So, here’s the scenario/context;

  • I want to sell virtual goods on my website (not NFT)
  • Users will sign-up using their online social media account (e.g. google/facebook)
  • Once they are signed in, they will see my single wallet’s receive addresses (where they can send ADA to)
  • After they send the ADA from their wallet, I want them to fill in a form and submit the transaction hash
  • I will have a cron job to query the tx hash (user’s have submitted throughout the day) to verify if they have sent ADA and how much
  • Depending on how much ADA they sent (1 vs 100 for example) I will issue some credits to their account to use within the app

Given the above - is this something that be achieved or will this be difficult without smart contract?
How will this work if multiple users are sending ADA to single wallet address? What if multiple users report the same tx hash?

Will I have to do something around transaction metadata?
For example, I can generate a unique “order number” and show that to the logged in user and request them to send ada with custom metadata and send the order number part of the transaction. So, when I query the transaction metadata, I will see it in there in my cron job?

My understanding of cardano protocol might be lacking, so apologies if this is not something that is possible or if this request is confusing.

I am looking to create a ecommerce like experience for the users on the app and I need a way to verify each user has sent ADA and detect the amount.

Thanks.
Latheesan

I think the best (only?) way to achieve this would be to give different receiving addresses to each user. This way you can safely assign transactions and wouldn’t have to make users enter the transaction hash (which wouldn’t work well anyways, since someone else could monitor the incoming transactions and front-run an actual sender). Metadata could work, but afaik that’s currently CLI-only and isn’t implemented in any wallet yet.

I think the best (only?) way to achieve this would be to give different receiving addresses to each user.

I thought about this option too, I imagine I’d need to use the wallet backend api and provision one wallet per user and somewhat securely manage that wallet on their behalf.

Then I could use an endpoint like this to grab the utxos for the provisioned wallet address and detect payments being made into it: Blockfrost.io ~ API Documentation