Giter VIP home page Giter VIP logo

enlight-me / decentralized-land-admin Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 4.0 25.23 MB

Decentralized Land Administration platform for the Ehtereum Blockchain

Home Page: https://transformatek.github.io/decentralized-land-admin

License: Apache License 2.0

HTML 2.60% CSS 1.40% JavaScript 78.76% Shell 0.14% Pug 0.25% Solidity 16.84%
blockchain land-administration land-registries foam-protocole geospatial-data reactjs h3 opengeospatialconsortium

decentralized-land-admin's Introduction

DeLA : Decentralized Land Administration

GitHub license GitHub issues GitHub stars GitHub stars

The land registry and real estate transactions is one area where security and transparency are important and where there is a high level of value, but where the required transaction speed and the number of transactions is significantly lower. People who have looked at this area, like the Economist, understand that the value for society may be enormous — not least in countries that lack stable institutions such as legal systems, land registries, etc.

The aim of this project is to implement the ISO 19152:2012 standard (Geographic information — Land Administration Domain Model (LADM)) on the Ethereum Blockchain.

The starting point for that will be the Solutions for Open Land Administration (SOLA-FAO) which is a J2EE implementation that has many uses cases in Africa and Asia. Using SOLA allows us to incorporate international best practice and standards, facilitating the essential customization always required to meet specific country needs, as Cadastre and registration functions and services are always provided by a typical land office.

This project is challenging because it implements geospatial data management features, needed to handle land parcels, on the Blockchain technology, which is an open research subject at the Open Geospatial Consortium where a Blockchain and Distributed Ledger Technologies Domain Working Group has been created especially for that.

One of the major goals for porting this land registry solution to the etherum blockchain is the ability to use it as a crowd sourcing land registry plateform to collect tenure relationships and as a tool for communities to assess and clarify their tenure regimes so to protect the individual and collective rights of their members.

Table of contents

Project Setup

DeLA plateform is a Decentrelized Application (dApp) for Land Administration built for the Ethereum blockchain. It comprises 03 components :

  1. The smart contracts written in Solidity
  2. The frontend web application built with react.js
  3. The backend application implementing a REST API to interact with the parcels map (optionnal).

To run this dApp, follow the instruction below.

Clone this GitHub repository.

git clone https://github.com/allilou/onchain-land-administration.git

Since the project is developped using the truffle framework, you should check the network configuration in solidity/truffle-config.js before continuing.

If you haven't yet setup developpement envirenment :

npm install -g ganache-cli
npm install -g truffle

Launch etheruem local developpement node :

ganche-cli

Install smart contracts dependecies (OpenZeppelin libraries) and migrate the solidity contracts to your local EVM.

cd solidity 
npm install @truffle/hdwallet-provider @openzeppelin/[email protected] truffle-assertions
truffle migrate --reset --network develop

For the rinkeby testnet (put your seed phrase in a text file on solidity/.secret):

truffle migrate --network rinkeby 

Install dependiencies and compile React/Web3 frontend web application.

cd client
npm install
npm start

To deploy to github pages :

export NODE_OPTIONS=--max_old_space_size=8192
npm run build
npm run deploy

Install dependiencies and compile Node.js/Express backend server (deprecated).

cd server
npm install
npm start

Usage

The following sequence diagram illustrate the overall process that will be implemented in the DeLA project .

To manage geospatial data transactions and visualisation, the FOAM protocole, described by the diaram below, is used. One can trigger a transaction simply by switching to editing mode and clicking on the map. A marker with the 'Transaction Hash' will be added at the clicked position on the map.

Singaling

As a broader vision, the DeLA platform will alow a signaling process, described by the diagram bellow, to incentivize cartographers to add features to the Feature Index database. Those featuers are necessary to allow basic users, with minimum knowledge on webmapping, to identify directly the features they own on the displayed map.

Implementation details

The FOAM protocole, developped by FOAM space was implemented using the White Paper with a set of solidity smart contracts and a client/server applications for the spatial index management and visualisation. Some modifications was implemented to explore the alternatives suggested by the OGC discussion paper ($7.5)

For the Crypto-Spatial Coordinates, the javascript interface of the H3 library was used with the resolution 15 (Average Hexagon Edge Length of 0.5 km) because it is a partially conforming implementation of the Geodesic Discrete Global Grid Systems OGC standard.

For simplicity, the geospatial data are stored in a Spatialite database. In the future and for scalling purposes, other geospatialy enabled DBMS, like PostreSQL/PostGIS, could be used.

For the spatial index backend, the OGC API - Features - Part 1 : Core and the ArcGIS REST API Feature Service was used as a standarized REST API dedicated to manage geospatial data objects.

For the frontend, the Leaflet library is used to display a map with a markers representing the added indexes.

Comparison with the FOAM protocole implementation

  • Spatialite -> PostgreSQL/PostGIS, redis
  • Leaflet -> deck.gl
  • H3 (DGGS) -> geohash
  • Truffle -> Chanterelle
  • JavaScript -> Purescript, Haskell

Other existing similar Blockchain solutions:

Further Reading

Proof of Location on blockchain

Blockchain business models

Land administration challenges

decentralized-land-admin's People

Contributors

akrammoussaoui avatar allilou avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

decentralized-land-admin's Issues

Security Requirements

  • Project includes a file called avoiding_common_attacks.md that explains at least 3 common attacks and how the app mitigates user risk.
  • explains what measures you took to ensure that your contracts are not susceptible to common attacks. (Module 9 Lesson 3)
  • Explain what measures you’ve taken to ensure that your contracts are not susceptible to common attacks (at least 3)
  • use MythX
  • use Mythril
  • use Slither

Switch DeLA to Enlight.me Organisations

OLAdmin :

  • Name : DeLA (Decentrelized LandAmin)
    *contracts
  • add RRR
  • add dispute
    struct Transaction {
    address destination;
    uint value;
    bytes data;
    bool executed;
    }
    const ProjectStatus = Object.freeze({'Waiting':0, 'Rejected':1, 'Approved':2, 'Disabled':3})

*client:

  • dispute/bid

Handle Parcel registry

The parcel registry should be handled by the dApp.

  • In case dggsIndex is already claimed log an error
  • Add user address Index too

User Stories

Creating several user stories can help the evaluator understand what your dApp is and how potential users are supposed to interact with it. User stories outline how users will interact with the application. They should be descriptions of end goals of the application rather than descriptions of features.

Truffle : run on a local dev net

  • A project README.md that explains your project. What does your project do? How do you set it up?
  • I can run the app on a development server locally for testing/grading (or connecting to Rinkeby/Ropsten if required)
  • Your project should be a truffle project
  • All of your contracts should be in a contracts directory
  • Truffle compile should successfully compile contracts
  • Migration contract and migration scripts should work
  • Truffle migrate should successfully migrate contracts to a locally running ganache-cli test blockchain on port 8545
  • All tests should be in a tests directory
  • Running truffle test should migrate contracts and run your tests

Stretch Goals

  • Project uses IPFS (The app is hosted on IPFS or allows users to interact with IPFS.)
  • Serve the UI from IPFS or a traditional web server
  • The project uses and upgradable design pattern for the smart contracts (Interfaces)
  • At least one contract is written in Vyper or LLL
  • The app uses uPort for user authentication and/or signing and sending transactions
  • The app uses the Ethereum Name Service to resolve human readable names to Ethereum addresses
  • The project uses an Oracle service such as Oraclize

UI : switch to functionnal components and use react hooks

  • Click on the map should trigger "Add Feature to the Ledger"
  • Map should display all the parcels / Users parcels with a specific theme
  • Drawer should display the list of the users parcels

Switch to functionnal components

  • App.js
  • Map
  • Drawer
  • AppBar

Use react hooks for global state variables

  • createContext / useContext
  • useState

Manage feature geometry on IPFS/OrbitDB

  • Implement OrbitDB for managment of features geometries
  • save geometry hash to wkbHash of the smart contract
  • allow user to sketch his parcel on the map (Survey Points)

Record a demo

Record your screen as you demo the application, showing and explaining how you included the required components.

Design Pattern Requirements

Update state variables names in conformance with LADM

The LAParcel and LA ParcelRegistry Smart contracts variables and the UI must be conform to LADM:

  • parcelType -> landUseCode (residential/commercial/industrial/agricultural)
  • extAddressID -> extAddress
  • type_code (type of land parcel : parcel / building)
  • source_reference (documents...)
  • status_code (transaction)
    "pending"; "current"; "cancelled"; "completed"; "loaded"; "lodged"; "historic"; "approved";
    "previous";"archived"; "assigned"; "requisitioned"; "unassigned"; "rejected";"dead";
    "to-be-transferred";
  • name_firstpart / name_lastpart
  • dggsIndex -> referencePoint

User interface

  • A development server to serve the front end interface of the application (It can be something as simple as the lite-server used in the truffle pet shop tutorial)
  • The app displays/recognize the current ethereum account
  • I can sign transactions using Metamask (or another web3 provider)
  • The app interface reflects updates to the contract state
  • You should be able to visit a URL and interact with the application

SOLA Application Action Type

"addDocument";
"approve";
"archive";
"dispatch";
"withdraw";
"cancel";
"requisition";
"validate";
"lapse";
"lodge";
"assign";
"unAssign";
"resubmit";
"transfer";
"validateFailed";
"validatePassed";

Testnet Deployment

  • Project includes a file called deployed_addresses.txt that describes where the deployed testnet contracts live (which testnet and address)
  • Deploy your application onto one of the test networks. Include a document called deployed_addresses.txt that describes where your contracts live (which testnet and address).
  • You can verify your contract source code using etherscan for the appropriate testnet https://etherscan.io/verifyContract

Testing

  • Write a sentence or two explaining what the tests are covering, and explain why you wrote those tests
  • 5 tests written in Javascript or Solidity (or both) ( If the contract is so simple as to not require 5 tests for full coverage, it is okay to issue 5 points for less than 5 tests)
  • Tests are properly structured (Each test sets up context, executes a call on the function to be tested, and verifies that the result is correct)
  • All tests pass

Deploy to github pages

  • use github actions or travis CI
  • create github pages for the app and deploy the build with Rinkeby config

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.