Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: 100bitcoin on May 14, 2014, 06:15:29 PM



Title: Is it the correct way to accept Bitcoin ?
Post by: 100bitcoin on May 14, 2014, 06:15:29 PM
To accept Bitcoin on our system, we are implementing the following process.

1. Showing user the amount of BTC she is supposed to pay.

2. Asking for the bitcoin address from where she is going to send the coins.

3. Providing her the bitcoin address where she needs to send the coin.

4. Asking for the Tx Hash from the user.

5. Now we are checking the amount, from address and to address in the raw data of the Tx Hash.

6. As soon as we are having 6 confirmations, we are accepting the payment.

Is there any problem with it ?


Title: Re: Is it the correct way to accept Bitcoin ?
Post by: DannyHamilton on May 14, 2014, 06:51:41 PM
2. Asking for the bitcoin address from where she is going to send the coins.

No.

No, no, no.

There is no "bitcoin address from where she is going to send the coins" with bitcoin.  You are doing this wrong.

Skip straight to step 3, and give the user a unique address that is exclusively for this particular transaction.

4. Asking for the Tx Hash from the user.

Hashes can change.  They are not reliable when they are not yet confirmed.  You should not be using a TxHash to identify the transaction.  This is a bad idea.

5. Now we are checking the amount, from address and to address in the raw data of the Tx Hash.

Just check the amount at your receiving address.  Once the balance is paid and confirmed, you are all done.

6. As soon as we are having 6 confirmations, we are accepting the payment.

6 confirmations?  Is this really neccessary?  You'll have to look into your particular business requirements, but perhaps 3 confirmations would be enough in most cases?  Perhaps you really need 10 confirmations?  It would be a good idea to understand your particular needs rather than choose an arbitrary number without knowing if it will meet or exceed your needs.

Is there any problem with it ?

Yes.


Title: Re: Is it the correct way to accept Bitcoin ?
Post by: jbrnt on May 14, 2014, 07:23:16 PM
2. Asking for the bitcoin address from where she is going to send the coins.

When I buy something with bitcoin, I do not know which address I will send from. All funds may be from one address or combined from a few addresses. Some may even send directly from an exchange and users have no way of knowing the sending address.


Title: Re: Is it the correct way to accept Bitcoin ?
Post by: Abdussamad on May 14, 2014, 07:26:59 PM
What about male customers?


Title: Re: Is it the correct way to accept Bitcoin ?
Post by: justusranvier on May 15, 2014, 02:08:26 AM
6. As soon as we are having 6 confirmations, we are accepting the payment.

6 confirmations?  Is this really neccessary?  You'll have to look into your particular business requirements, but perhaps 3 confirmations would be enough in most cases?  Perhaps you really need 10 confirmations?  It would be a good idea to understand your particular needs rather than choose an arbitrary number without knowing if it will meet or exceed your needs.
This paper could be the basis for an improved calculation: https://bitcoil.co.il/Doublespend.pdf