Bitcoin Forum
May 21, 2024, 03:48:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Implementing a bitcoin payment system  (Read 203 times)
markthedark (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
August 17, 2018, 10:05:26 AM
 #1

Hello,

we are looking into implementing a Bitcoin payment system and are wondering about a few things.

Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real.

Best regards,
Mark
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 17, 2018, 11:18:32 AM
 #2


Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real.


No. You really shouldn't try to process a transaction that has 0 confirmations.

An experienced bitcoin user (Or anyone that isn't using a webwallet really) could doublespend the transaction, in which case your system would receive nothing but does "process/credit" the transaction.

Read more about doublespending and how it exactly works here, https://coinsutra.com/bitcoin-double-spending/

~It makes me wonder though, what service are you creating where you can't wait for 1+ confirmations?

Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1583
Merit: 1278


Heisenberg Design Services


View Profile WWW
August 17, 2018, 11:34:29 AM
 #3

Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
No, not really.
Transactions would stay unconfirmed only on rare cases. These may include, very low to null transaction fees. A miner won't include the transaction in block if he doesn't gain anything from spending his power to mine. A required minimum fee transaction may eventually get confirmed sooner. Tx won't get unconfirmed when the coins are spent from unconfirmed transactions or the coins are double spent. These are some of the possible reasons when the tx gets stuck in the mempool. Also a tx will stay in the mempool for 14 days (though I am not really familiar about this). After this time period it gets dropped from mempool, or the tx may get dropped when the mempool gets full.
Although you can check them manually by entering the txid in any block explorer and see to the fees. A recommended fee tx will be included in the block.

Quote
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real
If you pay a higher fee, it would be confirmed soon. You can't exactly check them manually I guess. Also why don't  you wait for confirmations?
Thirdspace
Hero Member
*****
Offline Offline

Activity: 1232
Merit: 738


Mixing reinvented for your privacy | chipmixer.com


View Profile
August 17, 2018, 12:25:17 PM
 #4

Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
transaction included in a block means valid confirmed transaction
there is no other measure to guarantee successful transaction than that

Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real.
if it stays queued in a mempool because of low tx feerate and busy network, you could do CPFP
it would increase the chance to get included/confirmed in the next block found  

odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3231



View Profile
August 17, 2018, 04:45:03 PM
 #5

Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real.

Check out Lightning Network. It might be a good fit. It allows you to make instant Bitcoin transactions, though it isn't as straightforward as a normal Bitcoin transaction.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
seoincorporation
Legendary
*
Online Online

Activity: 3164
Merit: 2947


Top Crypto Casino


View Profile
August 19, 2018, 09:22:01 PM
 #6

Hello,

we are looking into implementing a Bitcoin payment system and are wondering about a few things.

Is there anyway to make sure that a transaction, with which someone will pay us a certain amount, will really be successfully validated and processed before it's actually inside a certain block?
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real.

Best regards,
Mark

Hello Mark. The only way to be sure is waiting the transaction get the first confirmation. The problem here is... if you accept a transaction as valid without confirmations, then you can get a double spend, and that way the coins will never arrive to your wallet. There is no way to be sure that the transaction will not have a double spend unless it's confirmed.

Hope this information helps, other way you can google about double spends and the risk they have.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
August 20, 2018, 09:02:09 AM
 #7

You can't make sure that a transaction will for sure confirm. But you can achieve a pretty high probability.

For example, if you have multiple nodes geographically spread and let the customer choose a fee which is high enough you can calculate the probability of a double spending to occur after a given time.
Especially with multiple nodes, since you are able to detect a network split within seconds. The fee will guarantee that the confirmation will follow within the next blocks.

Such a concept is good enough to sell coffee for BTC.
You let them pay and after their coffee is finished you will have a high probability of the transactions going through.

Note that this requires the miner to be honest and NOT to cooperate with the malicious customer.


For stuff being worth a few $ this totally is fine. But i wouldn't use that for larger sums AND also not for online purchases (anonymity makes a difference here).

nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5614


Self-proclaimed Genius


View Profile
August 20, 2018, 10:00:57 AM
 #8

Quote
Since the txs can hang in the mempool for quite some time, it's not really an option to wait till it's included in a block for real
If you pay a higher fee, it would be confirmed soon. You can't exactly check them manually I guess. Also why don't  you wait for confirmations?
His team might be aiming for instant payment system that doesn't require a 3rd-party API or exchange-like system.

Depending on your business model and preferences, it's quite possible using Bob's interesting and promising concept.
You must also consider mandatory requirements to the invoice page like transaction fee that was suggested by something like a bot/program that can accurately compute the current recommended tx fee. If the buyer didn't sent the tx with that fee, notify him that he will have to wait for confirmation(s).

Another, if he's in the actual location (in coffee and pizza cases), quite simple, you can safely accept unconfirmed transactions on the counter.
The person's there, so why not?

Note that this requires the miner to be honest and NOT to cooperate with the malicious customer.
Like every million-dollar mining pools will conspire to steal a cup of coffee  Roll Eyes

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
August 20, 2018, 10:34:29 AM
 #9

Note that this requires the miner to be honest and NOT to cooperate with the malicious customer.
Like every million-dollar mining pools will conspire to steal a cup of coffee  Roll Eyes

The reason i have added this is to make clear that its possible to accept 0-conf payments for low-value goods (coffee).
But for higher amounts where once COULD cooperate with mining pools it is not safe to accept them. And OP has to choose the limit until it is worth the risk for him to accept 0-conf payments.

Therefore instead of suggesting to accept 0 conf payments until X$, i gave OP enough information to conclude the maximum amount to accept with the desired risk for himself.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!