0

What would be an easy way to simulate a double spend on a locally running ethereum blockchain? Could ganache help with this? Could someone please point in the right direction? We are trying to build a monitoring tool to detect double spend but don't know how to create a double spend in the first place.

sat
  • 5,489
  • 10
  • 63
  • 81

1 Answers1

0

the idea of double spend is quite simple you have to get two or more nodes in pow sync and start mining then use one node to spend your ether after that stop it from broadcasting changes to the network and get it back to the older block before you spend your ether now resume mining but give the node more power so it can mine faster then the other your attacker blockchain will become the longest chain now you can resume broadcasting this will be challenging but you can use the miner Api https://github.com/ethereum/go-ethereum/wiki/Management-APIs provided with Geth to manipulate mining and blockchain process and transactions.

Chamsddine Bouzaine
  • 1,299
  • 10
  • 17
  • Thank you. How do we go about this - "get it back to the older block before you spend your ether"? – sat Jan 05 '20 at 03:22
  • One option might be to restart the node by deleting the data directory and start the miner on one node with more threads and make it longer than the other one and then addPeer again. Could that be one of the options that could count as double spend? – sat Jan 05 '20 at 03:34