I'm currently doing a research on bitcoin and I would like to know if there is anyway to replicate double spending in the testnet or regtest? If isn't possible is there any other type of "attacks" that can be replicated?
If you have some hash power, you can perform Finney attacks on testnet. With regtest, you can perform any attack requiring 51% of the hash power since on regtest you are 100% of the hash power.
For a double spend, on
-testnet create a transaction and let it broadcast. Restart bitcoind or bitcoin-qt with
-tesnet -zapwallettxes=2 and then go ahead and respend your utxo's.
Note: I'll be honest, I haven't actually any BTC on testnet to try this with, you may also have to delete your testnet
mempool.dat before restarting the node - try it?