Skip to content

VitalJeevanjot/sedo-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sedo Network is a service that will let you sell and buy any domains registered anywhere through ethereum blockchain. The service plays a trusless intermediary role between seller and buyer.

With the power of oracles, We can finally conclude agreements between multiple parties on the blockchain from internet as a source of truth (Trusted sources / APIs) with the power of Chainlink Tools


What's in this repository:

This repository contains Smart Contracts as Backend and Backend Api

Smart contracts as backend:

2 Versions: Both contains 3 smart contracts:

governance.sol

do-escrow.sol

VRFTXT.sol

  • Remix editor version: It imports contracts and interfaces from github raw files.

  • Npm version: This imports files with npm as node modules.

Backend Api:

Backend api have 2 endpoints:

  • Whois /whois/<tld> It will Returns public emails registered with domain with keccak256 version. For example if your email is just like mine. Then you will get something like...

cac55ec6206f4d48a787103be5bd32f7fbb6ae0ef5a0704b33e90fc8790206c4

Make sure your whois guard turned off and you are registered with your email at domain's registrar.

You can see what your email says here https://emn178.github.io/online-tools/keccak_256.html

  • TXT Record /auth?domain=<tld> It reads all the Txt records from your domain name. Make sure there exist no other TXT record when you test this repository with the domain that you like to put on chain

Testing Sedo-Network

Testing can be done in different ways of this repository, Either Open zeppelin , Truffle or Remix editor

For Demonstration purposes we will use Remix Editor with Kovan Testnet with own chainlink node for handling custom jobs:

Governance.sol

  • Let's first deploy Governance.sol smart contract on remix editor

  • Now we need client (do-escrow.sol) and randomness(VRFTXT.sol) to register so Deploy them with governance deployed contract address...

  • After deploying, Register them with Governance contract.

Make sure to send some Testnet Link Tokens to your smart contracts, do-escrow and VRFTXT

Do-Escrow.sol

  • Once All three smart contracts are set, Lets Register our first domain with putDomain function.

I am using keybase.us which is my domain (Whois guard turned off) and also i am making it on Sale For only 100000 wei fake ETH.

  • After the Transaction, Wait for sometime before VRFTXT.sol Generates the random TXT record for you to put it into your domain.

  • Please call entity with your domain name again and Once you have TXT Value Just add it into your domain and Remove any other TXT Record either from Email service or Domain.

I am using Namecheap, You can check your domain registrar method to add TXT record on root domain (tld)

  • https://api.blockin.network/auth?domain=keybase.us This endpoint returns the TXT record you have for your domain (Using backend api service, I have uploaded on repo (read above)), Just change keybase.us to your own tld before doing verification from smart contract.

  • Once done, Pass domain as url parameter for verifyDomain function, Like this domain=<your_tld>

This will check the domain TXT record by calling api with chainlink oracle and match with what's created and stored in smart contract storage for that domain.

  • Please wait for sometime to let the chainlink node handle this request for you...

  • After some wait, Please call entity again with your domain, And you can see your domain is verified

It's time to test BUY Domain

  • From editor change your account to someone else and run buyDomain function with domain_name , email_address (which will use to scan user) and value The value needs to be exact same as the seller wants to sell this for, call entity to know the amount...

Fill the values

Click on buy domain

Now release of funds

The funds can be only released if you trasnfer your domain to the right user and if Whois scan return user email that matches the email added by buyer

  • Type the domain (if you are current owner (registered on chain)) and click releaseFunds

The job will be completed by chain link node

  • After successfull verification, It will run further states, to reset old user and add new user, transfer the money to old user etc.

VRFTXT.sol

This can also holds TXT records for domains and Domains for TXT records, If someone wants to find the values.


Using Npm (Open zeppelin, Truffle)

  • The contracts can be deployed easily and what to deploy and how to assign can be seen above. You can create a script that can do that for you.
  • In this Directory https://github.com/genievot/sedo-network/tree/master/app/src You can check scripts eth-send and link-send To transfer Ethereum and Link tokens to any address respectively (Have to change target address inside the script)
  • You will need secrets.json File inside app directory
{
    "mnemonic": "<private_key_or_seed>",
    "url": "https://kovan.infura.io/v3/<project_id>",
    "endpoint": "localhost:8545"
}

Deployed Contracts

Domain Offering and Registration: 0x819BA2e9dECf30108403C1656a66676c2857e5EA

Governance.sol: 0xc597D514673C9843BF65A29a0a9038782A201747

VRF TXT Maker: 0x3e802eF1a0afdD66fDff35dCABa13cdC784C20ae


Subgraph Using

https://github.com/genievot/sedo-network-graph


Front end serving at

It only searches for the domains right now. If no input then it shows current user's domains otherwise you can search the domain that is if registered. https://www.sedo.network/#/

The project is incomplete and requires more features to be add on and audit before moving to production. So it is recommended not to use it with real money or involve any real money in to this. For any further assistance, Please contact me on my discord Genievot#6561