Discover the Building Blocks of Districts: The Diamonds are in the Details

In our last Districts Digest, we discussed upgradeable smart contracts. Those smart little contracts make it possible to optimize code, enable governance-driven updates, address bugs securely, and add new features without overhauling existing systems. But, have you ever wondered what powers the infrastructure of Districts’ virtual world? Meet the EIP-2535 Diamond Standard, a cutting-edge approach to smart contract development that’s flexible, scalable, and user-friendly.

As you probably know, smart contracts are inherently immutable, meaning their code cannot be changed once deployed. This immutability ensures trust and security in blockchain systems but poses a challenge for upgrading or modifying contracts when necessary. Traditional methods, such as updating state variables or tweaking logic within the original contract, allow for some degree of "pseudo-upgradability," but significant changes that are sometimes needed, like adding new methods or altering functionality, are impossible. With the Diamond Standard this all changes.

How Diamonds Transform Districts

Diamonds are special types of upgradeable smart contracts that are especially flexible and scalable. Think of it as a modular building where you can swap out individual “facets” without rebuilding the entire structure. This allows smart contracts to be upgraded and expanded seamlessly while keeping the foundation intact.

The Diamond standard defines a way for these facets to be added, upgraded, or removed from an existing Diamond deployment. In practice, we can deploy one single Land Bank contract (which is a Diamond) with a single address and then add features to it with facets over time as needed. 

Why Does it Matter?

From a user’s perspective, Diamonds simplify interaction with Districts by keeping contract addresses stable, even as new features roll out. Aggregators like OpenSea support Diamond NFTs, and specialized tools allow users to explore facets and functions. For example, we can enhance Land Pixel trading with ERC-4494 permit support, enabling single-transaction trades without deploying a new contract. This means existing Land Pixels continue functioning seamlessly, with the same NFT contract address, even as updates are introduced.

Diamonds aren’t just functional—they’re efficient and future-proof. Diamonds enable virtually unlimited features while maintaining a single, stable contract address for better user experience by allowing modular facets to be added, upgraded, or removed. They also optimize gas usage, making them ideal for complex contracts. For example, implementing features like ERC-4494 can streamline NFT trading, reducing transactions from two steps to one, enhancing usability and performance as Districts evolves.

While Diamonds are innovative, they are still an emerging standard and require specialized libraries and tools. Although some platforms and explorers like Etherscan aren't yet fully optimized for inspecting or interacting with Diamond contracts, as more and more projects adopt the standard, this situation is improving, and our team has the expertise to navigate these challenges and maximize the potential of this cutting-edge technology.

While the Land Bank and Land Pixels are Diamonds, other elements like the Marketplace and $DSTRX (Districts governance token) remain standalone. This approach balances efficiency with usability, ensuring the best experience for Districts users.

Discover the Details

To learn more about the Land Bank, Land Pixels, and the governance token, DSTRX, read out our whitepaper. Additionally, you can explore the Diamond Standard further with tools like louper.dev or dive into the reference implementation to understand the architecture behind Districts.

Diamonds are at the heart of Districts’ innovation, delivering a scalable, flexible foundation for our virtual world. And there’s more excitement ahead—the LandRush in NYC is coming in Q1 2025! Stay tuned as we continue to build and refine the future of Districts.

Thank you for being part of the Districts community!

The Districts Team