I'm looking for a wallet that won't download the whole BTC blockchain, like Blockstream Green, and can connect to my local Regtest server. I teach a basic hands-on class with Testnet3 BTC, where students use their smartphones to send each other testnet BTC (tBTC). The problem is, I keep running out of tBTC because of transaction fees.
If I could switch to Regtest, I could just create my own Regtest BTC and never run out. What’s the best way to set this up, especially from a technical standpoint? Do I need to install something like Electrum or Electrum Personal Server, or what?
I thought about tweaking the Blockstream Green code, but I’m not sure that’s the right path and I’ve had a tough time getting it to compile and link.
Also, I can’t seem to find an Android or iPhone wallet that supports Regtest. Has anyone tried this before? Any tips would be super helpful!
I never done something like this, but how about running your own signet network[1]? Electrum wallet support it since 2021[2] and support many OS, with exception of iOS. You'll also need to run your own Electrum server, where 3 Electrum server implementation support signet[3-5].
Alternatively, run your own testnet network.
[1] https://en.bitcoin.it/wiki/Signet#Custom_Signet
[2] https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES
[3] https://github.com/spesmilo/electrumx/pull/122
[4] https://github.com/romanz/electrs/pull/762
[5] https://github.com/cculianu/Fulcrum/pull/108
Instead of messing with regtest, you can use testnet4. Due to a number of reasons, testnet3 is being deprecated and will soon be replaced by testnet4, and this is one of the reasons fees have skyrocketed in testnet3. Electrum supports testnet4 since 4.5.6, if you don't want to download the entire chain.
You can ask me for some free coins, if you need.
If you go offline for 20 minutes, and try to generate new coins locally, then you can do that with just a CPU. Which means, that if you have any local network, and all nodes will be connected into that, then you can locally mine some coins, do any tests you want, and then, all of those coins will vanish, when you connect to the real network (but if you treat test coins as worthless, then it is not a problem).
If you have any working setup, then it is all about isolating your client from the real network. Then, you can locally mine anything, with minimal difficulty, and then those coins will really be worthless (because coins from the live network are now traded for real satoshis on some exchanges).
Yes, you can do that. You can just setup a local WiFi network, have some server there, and if students will connect to your server, then they should see the coins you generate on your CPU.
Those coins are also traded on exchanges, so they are no longer worthless. If you need really worthless coins for testing, then you can use regtest, or pick any network, where you have a working setup, and just use minimal difficulty, which is available there. For example: even if you start mainnet, then you can also work with the minimal difficulty, as long as you will ignore the real chain, and start mining on top of the Genesis Block.
They are worthless in the sense that I can give him a couple for free to play with, which are far more than enough to do all sorts of testings, even to give some to all of his students to play with.
I did the same in the past, regtest works great. You just need one node. It might also be useful to also setup an electrum server on regtest.
With a watch command, you can easily set a shell to mine for a block every X seconds.
Regtest is useful in a classroom context because it is really easy to deploy and have a consistent setup.
You can't stop people from exchanging coin on network that available publicly. But while you can your own private network (whether it's based on testnet or mainnet), i have difficulty finding such up-to-date guide.
Thanks for sharing your experience. But since you say it's also useful in classroom context, can you mention list of Bitcoin wallet for Android/iOS which support regtest? Or do you expect all student bring their own laptop? Or do you expect OP to borrow a computer room?
I don't know what is available for regtest on android and IOS.
The electrum source code seems to have you covered, if you are willing to put some effort: https://github.com/spesmilo/electrum/blob/master/contrib/android/Readme.md