Giter VIP home page Giter VIP logo

smart-name-system's Introduction

Smart Name System

Description

A decentralized application built with Solidity for Ethereum Blockchain. It provides a name registry and some services. This application has been built as final project during the Consensys Developer Bootcamp It's composed of several smart contracts and a web application.

Demo:

IMAGE ALT TEXT HERE`

Smart contracts deployed on Rinkeby testnet :

Features

  • Register and manage names with the same format as tradtional domain names (ex: mywebsite.org)
  • Associate Ethereum public address to a name, to not memorize a complex address (ex: 0x137DCF94E2DEFF923e0A609b1d877BE9288243C8 )
  • Send crypto currencies to a name
  • Buy / Sell names on a marketplace
  • Resolve names

This application generates a smart contract for each name registered. That allows to represent a name by an asset, to certify it and create a proof of existence on Blockchain. Moreover, the name can be exchanged without third party service.

Concepts

SmartName

A SmartName is a name with the same format as a traditional domain name name.tld (test.com, steve.fr, etc.). The name is limited to 16 characters and the tld to 4 characters. They are no restrictions on the content of the name and tld unlike the registers of traditional domain names. A Smart Name is composed of :

  • id (bytes32) : unique identifier
  • name (bytes16) : name of the SmartName
  • ext (bytes4) : extension (tld) of the SmartName
  • administrator (address) : address of the owner
  • record (address) : address associated with the SmartName

Registry

A SmartNameRegistry allows to manage the SmartNames. Users can use the registry to :

  • Register a SmartName
  • Abandon a SmartName
  • Modify the ownership of a SmartName
  • Modify the record associated with a SmartName
  • Get informations about SmartNames registered

The implementation of the registry implements some design patterns to manage access, to control contract life cycle and to provide security.

Services

To create services and provide some applications with these SmartNames, a SmartNameService contract can be used. It provides an interface that allows to communicate with the SmartNameRegistry.

Resolver

SmartNameResolver is a service that allows to get some informations about a SmartName like :

  • Which is the administrator
  • What is the record associated
  • What is the address of the SmartName contract

Banking

SmartNameBanking is a service that allows to send Ethers to a SmartName. Amount of Ethers is sent to the record address associated with the SmartName.

Market

SmartNameMarket is a marketplace that allows to put on sale and buy SmartNames.

Possible improvements

Several things can be improved :

  • SmartName as non-fungible token

    • SmartNames are unique object, with their own properties. So, they can be represented with a standard non-fungible token like ERC-721.
  • Bridge between smart names and domain names to protect identity

    • A no restrictions registry allows anybody to register any names ; it's can be problematic like with the domain names, with phishing and cybersquatting
    • To prevent that, we can restrict the register of a smart name only to the real owner of the same domain name. For example, if Bob wants to register the smart name bob.com, he should register the domain name bob.com with a registrar (Cloudflare, OVH, etc.). These restrictions can be applied only with existent extensions.
    • To do that, it's possible to certify the ownership of the domain name with DNSSEC and add a TXT record with an Ethereum public address. During the register of the smart name, the contract can verify that the Ethereum address of the user matches with the TXT record of the domain name. This system is already used by Ethereum Name Service and an oracle exists : https://github.com/ensdomains/dnssec-oracle
  • Re-organize registry contract

    • Actually, one contract can only support this format : name.tld. To manage subdomains (sub.name.tld) and better organize the data, I think it will be better to take example of a traditional system of domain names. System of Domain Names
    • Each level can be represented by a smart contract
  • Fix some bugs

  • Implement others design patterns to manage roles, store list of names, optimize gas, etc.

  • Audit security

Technical description

Technologies

Contracts

  • Solidity
  • Truffle
  • Javascript tests with web3

Web application

  • VueJS app
  • Web3

Architecture

Simple UML

Simple UML

Complete UML

Complete UML

Design patterns and security

Test it

Prerequisites

Installation

Tests

Launch private blockchain with Ganache

ganache-cli

Launch tests

cd smart-name-system-contracts

truffle tests

Application

Launch private blockchain with Ganache

ganache-cli

Copy private key of an account from the ganache-cli terminal.

Deploy contracts

cd smart-name-system-contracts
truffle migrate

If error of type not found compiled contract, delete /build/contract folder

Start application

cd smart-name-system-app
npm run serve

Connect to Metamask

  1. Open web brower
  2. Create Metamask wallet
  3. Import account
  4. Paste private key of account
  5. Connect with this account

Go to application

Go to localhost:8080and enjoy

smart-name-system's People

Contributors

stevedespres avatar

Watchers

James Cloos avatar

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.