Maybe I should also add a Bitcoin node to this. I am getting tired of having to own a PC just to run Bitcoin.
Discussion
Wdym, there are a million Bitcoin wallets for mobile. You don't need a PC for Bitcoin.
That runs a full node without relying on any server infrastructure?
Sure you can have that too. Why do you need a full node, do you need a TB worth of Blockchain data on your phone? Weird but yes, it exists.
I just want to validate my own funds. So, it can be a pruned node with my wallet in it. The main point is to not rely on anything else.
Yep, you can do that too. Pruned also means downloading and verifying the entire blockchain.
That's fine. As long as no server is involved.
You can just do things.
How hard is to recreate a Bitcoin node from scratch focused on the mobile usecase? Can AI rebuild Bitcoin itself already? :)
It exists and has been done countless times sir. Just Google.
I saw a few. They all suck. They are either imcomplete or they try to do the same shit the desktop node is doing, which doesn't make any sense. It's the wrong approach.
Maybe I do need to get into this...
What would you do better than bitcoind?
Bitcoind is not designed for a mobile user:
1. Setup a wallet before starting to sync so that the system can prune the important thing.
2. No need for any of the RPC stuff.
3. No need for the desktop GUI
4. No need for any of the configurations they offer today.
5. All the gossip stuff can be reduced to simply receiving a transaction for 0-conf notifications and not doing anything with it.
6. The node just observes new blocks. It doesn't send anything to anyone else. It doesn't "participate" in the network outside of simple transaction broadcasting.
7. No advanced wallets. No scripts. No multisigs, nothing crazy coming from the phone.
Etc, etc, etc.
All we want is a simple wallet that you can receive and send. It's not a wallet for large funds, just small services. A checking account that is on-chain.
I think you'll find that you have no option but to use bitcoind and configure it correctly (it doesn't have a UI) 🤷
Idk what you mean by gossip stuff but bitcoind has a mempool and all it does is to propagate transactions and blocks.
Doesn't it do much more than that? Like it doesn't even make sense to cache or organize the mempool on mobile.
Bitcoin doesn't work without mempools, esp if you want "no other server" (other Bitcoin peers are servers too but I think I get your point).
It's practically impossible to build your own implementation anyway so you will find that you have to use bitcoind.
You understood what I meant. The infrastructure is overblown for mobile. It needs to be 100x leaner.
Nobody would do what you want to do. SPV wallets are a thing and they've been around for 15 years for Android.
FWIW I’m pretty confident that if you stripped out anything extraneous here you’d end up with something that is 99.99% as CPU-/network-/memory-/etc-intensive as bitcoind with -maxmempool=0. It’s basically that or you jump to asking a server for SNARK proofs of the full chain.
It could be. As long as the remaining processes run as a mobile app, not as deamon. The app show start, sync and be removed from memory every 15 mins or so. Than a separate Android Service simply listens to 0-conf transactions for simple notifications. The important part is a complete redesign of the interface to do the simplest thing Bitcoin does and nothing else.
I like it. We need more experimentation with bitcoin nodes. The biggest problem is recreating bitcoin consensus logic. You basically can't guarantee it will stay in consensus, so that's a bit of an issue...
You could probably get very far with blocks only mode. It has a mempool so you can simply drop every transaction you aren't interested in and keep the ones you are watching for via sendrawtransaction.
Not sure how you would learn about the transaction if your node isn't listening when it floods across the network. Perhaps a mempool nostr relay that just replays transactions as nostr events.
Yea, I mean you could just run bitcoind and provide that interface on top 🤷‍♂️.
How would I start? Where do I get more info to set it up properly? Like syncing in the background while the user can create wallet and receive funds, etc.
Yes vitor .. how to do so ?
There’s been a few things to package and run core on mobile before, so that seems like a good start. I imagine they mostly work about as good as it’s gonna get from a backend perspective, then you’d just have to build the frontend? I believe on Android you can run a second process so you can just RPC it. On iOS You might have to embed, but I think that’s doable? If not you could try to go the libbitcoinkernel route though that won’t get you a wallet or P2P or (I think) a mempool.
So basically you want a light client but insisted on pushing full node software into that? Why not neutrino or building your own with BDK?
Agreed. Bitcoind was never designed to be a server. And RPC over HTTP is insecure.
That’s why we have things like the Electrum protocol, which was designed to be a proper backend server for syncing. (You can design a different protocol, but that’s another story).
How about having a method where you can set up and run a full node on PC that you own, and once that's done you can have a pruned version of it, of the latest x blocks, and then have that transferred to what amethyst manages and have it always be in that pruned state from then on (new blocks in, old blocks out, of the latest x number of blocks constantly being updated).
This results and you having verified the whole blockchain on a PC, and after that initial big workload, you'd have a self verifiable pruned version always being updated on your phone.
I'm not sure if somebody did this already or not, or if it can be done I'm not sure, but it's a good compromise and sounds reasonable id imagine.
Hey Vitor, just to let you know you can connect to your own (Electrum) node in several mobile wallets, including Nunchuk. Tor is possible too.
Ideally, I don't want any server. Just other Bitcoin nodes.
Note that on mobile it might be impossible to guarantee that your background process can run indefinitely. The OS will kill it from time to time based on resource constraints.
You might also want to check out compact blocks / Neutrino from Lightning Labs.
Yes, but that's in the past. If you set up services correctly, Android will keep them running. You have to keep them lean and that's my concern on just embeding Bitcoin core an app. Ideally, we would just use Android's native service infrastructure.
either you run a node, or someone else does it for you
Nice informative exchange!
We also see running a node as a way to cast a vote on the consensus (as in the most recent filter "war"), not just for transactional/routing purposes, however the more the marrier!
Do all nodes connect can talk to each other regardless if they run a whole version of the block chain or not?
The definition of 'node' is a little vague. I also consider bip158 ('neutrino') clients to be nodes, since they can independently verify their own transactions. But they don't really engage in stuff like forwarding unconfirmed transactions.
You can also run bitcoin core in pruned mode. In that case you drop block data that is irrelevant to you after verifying it, but other than that, you interact with the network in the same way that a full node would.
Thank you for the explanation.
I think I might do that (pruned version).
My node (knots on umbrel/ rasp. Pi) literally shit the bed over a power shortage (San Disk SSD apperently the real culprit) 2 weeks ago or I would send some zaps your way. Once it is fixed.
That makes me wonder, how are the OTS/nip03 events verified right now in amethyst? Because a simple header chain would mean it could be done locally
Yeah, we currently use me pool and blockstream's block explorers for that :(
Not the end of the world. Also i vibe coded a nip03 app a while back because the only other way to get the actual events was doing it manually via NAK, and saw that amethyst is a bit buggy in that i found a whole bunch of redundant timestamps on the same event, sometimes with the same ots-proof, sometimes days appart. Not that it is an issue but just fyi.
you can do it using the floresta node
I zapped your note with nwc minibts test wallet and it got jacked I think... About 4 minutes ago...
