Code Monkey home page Code Monkey logo

Comments (3)

bitrequest avatar bitrequest commented on September 11, 2024

If you have two requests for the same price (in crypto) at the same time, will both transactions go through after just 1 payment on the blockchain?

Yes, the app starts monitoring every incoming transaction on the address from the time the request dialog opens. Best practice is to use a new address for every request. The app will make a new address for every request if you use a bip39 seed or Xpub.

Also, is there a way to validate server-side that a transaction really did go through, and not just that the client sent a malicious API request saying the transaction was done?

With the web-intergration yes it's possible to post to the server and fake a order since the verification happens front-end and then posts to the server, that's why it's in beta. I haven't figured out yet how to make this waterproof. If you expect to not have many orders and you can check if you really got the payment before you send your goods this shouldn't be a problem. If you have any suggestions how to make this secure i'm happy to hear. It may also be possible to combine the webshop-integration with existing back-end payment processors for a better user experience, but still get the back-end confirmation.

For point of sale this shouldn't be relevant since you see the transaction verification happen in front of you. And it get's verification from monitoring the blockchain.

from bitrequest.github.io.

benkaiser avatar benkaiser commented on September 11, 2024

That's pretty neat. I was going to suggest a way to handle multiple simultaneous transactions would be to ensure the crypto amounts differ ever so slightly (even by 1 Satoshi or equivalent in each currency). But honestly I'm not sure many merchants taking crypto online would face this scale issue of duplicate values.

Regarding the validation (thinking again from the third-party site integration viewpoint). On the client-side, when it sees the transaction has gone through, could it send the hash to the server, and then on the backend you could make an API call to bitrequest.io with the hash the client provided and validate it was to the right address of the right amount? That's the most secure way I can think of. The only step in advance of this would be to create a transaction with bitrequest on the server, then open it on the client, then validate with bitrequest that the exact transaction that we expected was completed (so the crypto values all line up).

I'd be open to speaking about this more, do you mind sending me your preferred contact info to my email listed on my GitHub profile?

I'm looking to integrate this in a site I'm building To purchase digital items

from bitrequest.github.io.

bitrequest avatar bitrequest commented on September 11, 2024

I think using unique addresses is the way to go for having unique transactions. In the webshop-integration the address generation from bip39 seed or xpub would't work cause it's done client side. You should do it on your webshop's server. There might be some library's out there that can do this for you. Or you can make an array with like a hundred addresses manualy and pick a new one for each order. Having slightly different amounts wouldn't prevent your issue. Bitrequest picks up any amount and just says 'insufficient amount' if it's too low.

Regarding the validation; The transaction hash does get send to your server, so you can do a an extra check on the server to the mempool and check it with amount and if it was send to the right address. But your blockchain API should support Mempool lookup and there might be some small delay between the websocket and API call. With Nano there's a chance you can do the double check, since it's really fast, or you can make it pending until you have a confirmation.

Too be honest, the webshop-integration was basically an idea i had and i just put out the building blocks. It's not really a finished product. You are free to play around with it. My main focus at the moment is the Point of Sale functionality.

If you like too discuss more in depth you can reach me through the contact form on bitrequest.io and i'll get back to you.

from bitrequest.github.io.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.