project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Prop2Block

A decentralized NFT real estate marketplace on Ethereum and Polygon. Users can buy, sell, and transfer property tokens with metadata on IPFS. Features escrow services, multi-party interactions (buyers, sellers, lenders), and low gas fees on Polygon.

Prop2Block

Created At

ETHGlobal San Francisco

Project Description

This project is a decentralized NFT marketplace for real estate properties, leveraging blockchain technology to enable trustless property transactions. Each property is minted as a non-fungible token (NFT) using the ERC-721 standard. Property details, such as location, price, and images, are securely stored on IPFS to ensure immutability and accessibility.

The marketplace supports multiple actors, including buyers, sellers, lenders, and inspectors, with each party playing a critical role in completing property transactions through an Escrow contract. This contract enforces conditions like inspections and lending approval before transferring ownership. The application is built on Ethereum and deployed on the Polygon Mumbai Testnet to leverage low gas fees.

MetaMask integration allows users to easily connect their wallets, switch between networks, and conduct transactions seamlessly. The project is designed to provide a secure, cost-effective, and decentralized solution for real estate transactions, reducing intermediaries and increasing transparency in property ownership.

How it's Made

How the Project Was Made: The Nitty-Gritty Details

  1. Core Technologies
  • Ethereum & Polygon Blockchain: The application is built on Ethereum with plans to migrate or support the Polygon network (Amoy Testnet). The reason for choosing Polygon is to reduce gas fees and scale the solution, making it more user-friendly and cost-effective, especially for frequent transactions like NFT minting and property transfers.

  • Hardhat: The development framework used for smart contracts. Hardhat simplifies local blockchain testing, compiling contracts, running scripts, and interacting with contracts. It's incredibly flexible for debugging and allows rapid contract iteration and testing in a local environment before migrating to a live network like Polygon.

  • IPFS (InterPlanetary File System): IPFS is used for decentralized file storage of property metadata and assets (images, documents, etc.). Each property (token) stores its metadata on IPFS, making the data tamper-proof and censorship-resistant. Docker is used to run IPFS locally during development, while production can leverage public IPFS gateways or services like Infura IPFS or Pinata.

  • Ethers.js: Ethers.js is the library used to interact with the Ethereum blockchain, whether locally via Hardhat or via Polygon. It's easy to integrate into the frontend, supports MetaMask, and provides a clear API for sending transactions and fetching contract data.

  • MetaMask Integration: The frontend integrates with MetaMask to allow users to connect their wallet, manage transactions, and switch networks. MetaMask also provides wallet authentication and handles gas fee estimation. For production deployment, it helps the user easily switch to the correct network (Polygon Mumbai Testnet or Amoy Testnet).

  • React.js: The frontend of the application is built with React.js. React provides component-based architecture that helps with fast, modular development. It’s also easy to manage state (e.g., user’s wallet connection, network status, and NFT properties) with React’s hooks and state management.

  • Smart Contracts:

    • PropertyNFT.sol: A ERC-721 based smart contract that represents property tokens as NFTs. Each token points to IPFS for its metadata, ensuring the information about the property is decentralized.
    • Escrow.sol: A custom escrow contract that handles property transactions. It ensures that properties cannot be transferred unless certain conditions (e.g., inspection, lender approval) are met, enabling safe and trustless transactions between buyers, sellers, and lenders.
  1. How They Are Pieced Together
  • Frontend (React) and Backend (Smart Contracts): The React.js frontend communicates with smart contracts on the blockchain through ethers.js. The frontend prompts the user to connect their wallet (via MetaMask) and displays their account data, including properties they own, properties for sale, and transaction status.

    For transactions, the frontend encodes data (like property metadata, price, etc.) and sends it as a transaction to the PropertyNFT or Escrow contracts. The result of each transaction is then updated in real-time on the frontend via event listeners from the blockchain.

  • Hardhat and IPFS for Development: During local development, Hardhat runs a local Ethereum node to simulate the network environment. This local node is populated with mock accounts and transactions via a deploy script (deploy.js). IPFS is run inside a Docker container during development for storing property data. This mimics the decentralized storage that will be used in production.

  • Deployment to Polygon: When switching from a local environment to the Polygon Mumbai Testnet (or Amoy Testnet), Hardhat’s network configuration is updated. Contracts are deployed to Polygon via Alchemy or Infura as the RPC provider. IPFS or a public IPFS gateway (like Pinata) is used to ensure that property metadata is publicly accessible.

  1. Partner Technologies and Benefits
  • IPFS: IPFS decentralizes the storage of NFT metadata. This prevents reliance on centralized servers, ensuring that property data (such as descriptions, images, and price) are always accessible without a single point of failure. Using public gateways like Infura IPFS or Pinata simplifies the process of uploading and retrieving files from IPFS.

  • Alchemy / Infura: For the final deployment to Polygon, using Alchemy or Infura as an Ethereum node provider is crucial. It allows for smooth RPC connection to the Polygon network, significantly reducing the effort needed to manage Ethereum or Polygon nodes manually. Their reliable infrastructure helps with faster deployments, transaction broadcasting, and quick access to logs.

  • MetaMask: MetaMask plays a critical role by allowing users to connect to the dApp easily, sign transactions, and switch between networks (Ethereum Mainnet, Mumbai Testnet, Amoy, etc.). Its integration reduces friction for end-users when interacting with decentralized applications, making it a highly important tool for adoption.

  1. Hacky Notable Things
  • IPFS Locally Integrated: Running IPFS in Docker during development allows a smooth transition to production. However, creating a seamless experience between local IPFS and cloud IPFS was tricky, especially when switching from local development to public networks. Testing metadata storage on public IPFS before pushing to production was one way to ensure the transition was smooth.

  • Automating Gas Estimations: One challenge was underestimating gas on the Polygon testnet. By integrating a custom gas estimation mechanism, transactions were dynamically adjusted based on network congestion, leading to fewer failed transactions.

  • MetaMask and Network Switching: MetaMask was configured to prompt the user to switch networks if they were not on the correct one (e.g., when the user is on Ethereum Mainnet but the app needs Polygon Mumbai). This involved custom prompts using the wallet_switchEthereumChain API, reducing friction for users unfamiliar with network management.

Summary:

This project brings together decentralized storage (via IPFS), blockchain (Ethereum/Polygon), smart contracts, and a smooth user interface (React). The use of partner technologies like MetaMask, Alchemy, and IPFS greatly improved the ease of development and ensured a production-grade decentralized marketplace for properties. Despite the decentralized nature, we focused on providing a UX that felt responsive, reliable, and accessible.

background image mobile

Join the mailing list

Get the latest news and updates