pull down to refresh

Hi all, first post. New to Stacker News, apologies if the format's off.

I built BlockForge, a Minecraft-ish voxel world where the engine, the 32x32 chunk grid, textures, skins, and player edits are all Bitcoin inscriptions.

Users can build on a chunk, and make the changes permanent via parent-child inscription.

It's built with THREE.js WebGPU, and runs natively in browser on desktop & mobile.

A couple of details I had fun with:

  1. The whole world reacts to live BTC data: block height drives day/night cycle, transaction count and fee rates drive weather events & cloud density, plants live on a block cycle.
  2. Real-time Multiplayer runs through a WebRTC relay whose address is anchored on a Bitcoin sat (so the relay box is rotatable without re-inscribing the engine)
  3. The entire game is a single HTML file stored on-chain, pulling in library dependencies via recursion.

Check out the website https://blockforgebtc.com if you want to learn more! Free to walk around as a guest, no wallet needed.

Happy to answer architecture or implementation questions, and open to any feedback! Thank you!

Why... This is going to become far too expensive to be a game in the future...

However, I will applaud the effort. It's actually pretty awesome. A good educational experience for sure. But I don't think a game built on UTXOs as building blocks is the most efficient way to build a game world.

I'm more interested in the technicals of the server engine client relationship.

reply

Hey, thanks for the comment and the kind words!

In terms of prices, you'd be surprised. The full Engine is about 800kb, with Brotli compression that comes down to 150kb, so it costs ~$10 to inscribe a new version of the engine at current fees. The biggest complexity here is getting the entire game engine that small (all block definitions, animations, collision, interactions, etc).

When users complete a build, they inscribe updates to their entire chunk as a single JSON.

  • These are usually <20kb, and tend to cost less than $1. And then the build is on-chain forever.
  • Likewise, Skins and Custom Blocks are less than $1.

For the server/engine/client side, there actually isn't a traditional server distributing the engine or holding state. The architecture is closer to "peer-to-peer through a thin relay" than client-server.

  1. Engine delivery: Your browser fetches the engine directly from Bitcoin (ordinals.com/content/<iid>). No server of mine is involved in serving the game code.
  2. World state: Every chunk is its own inscription, and edits live on-chain as child inscriptions. The world IS the inscription tree.
  3. Multiplayer: The only off-chain piece is a small Pion (Go) WebRTC relay. It's not a game server. It just facilitates peer discovery and buffers recent edits for ~72h so latecomers see what was just built. Zero authoritative state, no accounts, no chunk data, no inventories.
  4. Even the relay is replaceable: Its address (IP, port, ICE creds, DTLS fingerprint) lives on a Bitcoin sat. Clients fetch it at boot from /r/sat/<sat>/at/-1. If my box dies, someone could spin up a new relay and re-anchor the address on that sat, and every inscribed engine would just pick it up.

So If the relay goes down, you can still play solo and inscribe permanent builds. If I disappear tomorrow, every owned chunk and its history remain, the engine still loads, and someone could resurrect multiplayer.

reply

very cool. you should use nostr relays for peer discovery.

Also that's what it costs now. But I think in the future that's going to cost a lot more.

reply

Thanks! I actually initially built this out with Nostr for peer discovery, but all Ordinals explorers block Norsr's websocket connections. The inscribed engine can't reach Nostr relays.

WebRTC datachannels aren't goverened in the same way, so the relay I'm using now was the only architecture that would work on ordinals.com.

The relay's connection details are publicly viewable a Bitcoin sat so the box itself is replaceable by anyone, which is the most decentralized I could get given the context.

Also yeah its very possible it gets more expensive in the future, but you could argue that would just make the builds already inscribed even more valuable.

reply

I'm pretty ignorant when it comes to inscriptions. Can you explain a little what inscriptions add to the game?

reply
I'm pretty ignorant when it comes to inscriptions. Can you explain a little what inscriptions add to the game?

Hey, thanks for asking! Totally fair, inscriptions are easy to miss the point of until you see one used for something concrete. Inscriptions are arbitrary data stored permanently inside Bitcoin transactions. Think of it as forever-storage that needs no server.

For BlockForge specifically, they do three things:

  1. The game IS an inscription. The engine (terrain generator, textures, multiplayer code) is a single HTML file stored on-chain. Your browser loads it from the Bitcoin network, not from any server I control. If I disappear tomorrow, the game keeps working.
  2. Chunks are inscriptions you can own. The 32x32 grid is 1000 inscriptions. Each one is a chunk, trade-able like any other inscription. If you own it, you own the right to build whatever you want on it.
  3. Player builds become permanent. Build something on your chunk and want it to stick forever? You inscribe the diff as a child inscription. It becomes part of the game's state for anyone who loads the world after.

tl;dr: The game world is not stored on a private server. If Bitcoin's running, BlockForge is running.

reply