Comment Bitcoin empêche-t-il les doubles dépenses?

Stephen Gornick

Stephen Gornick

Mise à jour il y a 294w · L'auteur dispose de réponses 207 et de vues de réponses 304.4k

Every amount of bitcoin that exists is a descendant from bitcoins that are issued to miners. There is a transaction history starting from the issuance of the block reward subsidy (current level is 25 BTC per block) and for each assignment from there.

So if a MiningPool receives a 25.0 BTC amount, and then pays 6.0 BTC to Alice, and then Alice pays 0.8 BTC to Bob, his "coin" descended from Alice's 6.0 BTC coin, and her coin descended form MiningPool's 25 BTC coin.

Then when the merchant learns of a transaction to one of the Bitcoin addresses in its wallet, a check is made to ensure that the funds used in that transaction have not yet been spent. So using the example from above, if Bob sends for pay to the merchant 0.5 BTC and the coin he uses for the payment is the 0.8 BTC coin received from Alice, the merchant's will see that the coin was not yet spent and thus the transaction can tentatively proceed.

The reason that is tentative is because the Merchant's copy of the ledger isn't complete yet. That transaction from Bob needs to be included in a batch of transactions. That is called a block confirmation. Somewhere out on the bitcoin network a miner will at some point also verify that the transaction is not a double spend and then will include that transaction in a batch (block) and then share that block with the entire Bitcoin network.

Once the merchant receives that block with Bob's transaction, the merchant can now be more confident that the coin wasn't spent twice because it has received a block confirmation.

There still are ways that Bob's transaction still cannot be fully trusted, due to the bitcoin network's decentralized architecture. The recommended threshold is for a transaction to have received six confirmations, after which there is essentially zero chance that the transaction could be reversed by Bob.

There can be miners with differing results for the same block, and that's where these conflicts between what the merchant expects to see in the blocks and what actually arrives in the blocks. At the threshold of six blocks from the point of when a transaction is first included in a block, there are no conflicts -- there was a single winner eventually whose solution was accepted by the network. This conflict resolution roughly correlates to whichever solution had the most work conducted by the miners, and that one ends up winning.

Leggi:  Quel est le site Web pour l’enregistrement bancaire en ligne auprès de la State Bank Of India?

So to summarize, a ledger consisting of batches of transactions is used to ensure that a coin wasn't previously spent and the miners come to a consensus in building the set of batches used.

This description leaves out a number of details as this is a complex topic. The block chain article ( ) in the Bitcoin(dot)it wiki describes more in detail about how proof of work ( ) is used to have the entire Bitcoin network reach consensus.

And this visual might help:

Comment Bitcoin empêche-t-il les doubles dépenses?

La source: Bitcoin: The Cryptoanarchists’ Answer to Cash

Osho Bajpai

Osho Bajpai, Software Engineer at Catchpoint Systems

Répondu il y a 27w

J'aime Stephen Gornick answer below , but it might be a little confusing to noobs .

I would like to simplify it ….

Imagine i have 100 cryptos and i want to send it to a person ‘A’ .

i will make a transaction , and this transaction sits in the transaction pool , remember it is still not confirmed and the transaction has a waiting status .

Now, i would like to send 100 cyptos it to a person ‘B’ . But i had only 100 cryptos in the first place , this is an invalid transactions.

Now, after the transactions have been placed in the transaction pool , it would be picked one by one , now since i sent 100 cryptos to person A , that would be valid if its picked first from the transaction pool. The similar case is for person B as well .

Now , the miners will add this transaction to the block , now when the second transaction will be picked , there would be a mismatch , since

amount > senderWallet.balance

see line 3 on the below code .

There would be no consensus , hence another miner would need to verify this ,
this process would go on until we reach a consensus .

Also , as a configuration we do this for minimum 6 times recommended (I have no reason to this ).

Once confirmed its added to the ledger and one of the transaction is rejected.

static newTransaction(senderWallet,recipient,amount){const transaction = new this();if(amount > senderWallet.balance){console.log(`this amount ${amount} exceeds current balance`);return;} // three dots is the spread syntaxtransaction.outputs.push(...[{amount:senderWallet.balance - amount , address : senderWallet.publicKey},{ amount , address : recipient}]);Transaction.signTransaction(transaction,senderWallet);return transaction;}

Leggi:  Quels sont les meilleurs moyens d'apprendre la programmation?

Mike Lin

Mike Lin, Recherche expérimentale sur la blockchain au lycée

Répondu il y a 38w · L'auteur dispose de réponses 159 et de vues de réponses 69.5k

Bitcoin does not prevent double spending in and of itself, because the mempool is not immutable.

Bitcoins can be double spent before they are mined into a block. That is, unless they get at least 5 block confirmations, which is a safe estimate for block finality.

This is why merchants do not release their item or service until the transaction is settled on the blockchain. Blocks are practically immutable, due the proof of work that is put into them. Trying to modify previous blocks require generating many proofs until you surpass the main chain, in which the blockchain can be tampered with.

Note, this is how it works in Bitcoin, not in chains like Ethereum where GHOST or a derivative is used for consensus.

Manish Malhotra

Manish Malhotra, Consultant et investisseur à long terme chez Self-Employment (2016-present)

Répondu il y a 52w · L'auteur dispose de réponses 433 et de vues de réponses 183.5k

In simple language:

Every transaction on blockchain needs to be approved or needs confirmations by the network. Confirmations range from 2 to 50 or more. These confirmations are done by miners or nodes who maybe sitting anywhere across the globe and always watching the transactions.Once the transaction is confirmed by them they record hash rate , time stamp, source and destination public keys on the block chain which is an open source ledger available to everybody. So once this is recorded , it simply prevents double spend.

For doing the above they charge mining fee.

Aaron Hall

Aaron Hall, a travaillé chez Bitcoin

Répondu il y a 96w · L'auteur dispose de réponses 52 et de vues de réponses 54.8k

Double Spending is a term that is used when the money used in a transaction is already used for another transaction. Previous digital currency like the first digital currency digicash from Netherlands and e-gold in the US has come under fire because of this issue. Hackers use this technique to dupe buyer and seller in online retail store because of the ease of reproducing digital currency.

Leggi:  Est-il possible de percevoir un paiement avec Google Forms?

This is quite a concern prior to the rise of bitcoin in the online world. Bitcoin was able to mitigate this problem by introducing check and balance using a peered network negating a single point of failure compared to a 3rd party trust based which is used in the real world financial sector. This open system network decentralized the management of the bitcoin system which avoid a single party’s complete manipulation of the transactions transpiring in the network.

Block chain cryptography was also introduced in bitcoin. Blocks are formed and includes networked time-stamped transaction with proof of work which is then encrypted with bitcoins state of the art SHA-256 encryption. Cracking this encrypted transaction is not viable to hackers because of the ever increasing difficulty of the encryption which adjust its difficulty in every 2016 block to maintain the 10 minute block creation. If you wanna more about how blockchain works, read the Joining of a Third Blockchain Project.

Zbigniew Lukasiak

Zbigniew Lukasiak

Répondu il y a 295w

The bitcoin system maintains a global, time ordered log of all bitcoin transactions. That means that everyone receiving that second transaction that tries to spend a coin second time will see that there was a previous transaction that already spent that coin and reject that transaction.

A sligthtly more technical answer is at my blog:

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.