Hacker News new | ask | show | jobs
by kexari 3191 days ago
Thanks for this. Any idea how to build a simple p2p network though (over the internet not local host) and make it decentralized? That’s the hardest part :p
1 comments

It's actually not that hard. Most blockchains use a variation of Gossip, which is quite trivial to implement. On startup, your nodes get a list of seed nodes, recursively ask for peer lists until they can connect to some "max peer count."

When they receive transactions (from a client, or a peer), they simply forward them to all other peers (if it's the first time they've seen them.)

That's basically it. :-)