New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC: Light Naming Service (DexNS) #668

Open
Dexaran opened this Issue Jul 11, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@Dexaran

Dexaran commented Jul 11, 2017

Title: Light Naming Service
Author: Dexaran, dexaran@ethereumclassic.org
Status: Draft
Type: ERC
Created: 11-07.2017
Resolution: https://github.com/Dexaran/DNS

Abstract

The following describes structure and cases of use for smart-contract based naming service.

Motivation

Interaction with contracts (even in test / try cases) is not user-friendly. ENS is quite advanced name service but it isn't so user-friendly.

I want to introduce a lighter version of naming service that will make easier interacting with contracts for regular users. The contract can store human-friendly string names, address of the owner, address of the destination (analogue of ENS resolver), string metadata, bytes32 signature of the name, bool variable to disallow contract to return name owner.

Contract consists of two parts: storage and logical part.

Advantages:

  1. User-friendly.
  2. Automated contract ABI and address loading by string human-friendly names.
  3. Convenient for establishing and announcing contracts on testnets.
  4. Instant registrations.
  5. Easy to upgrade without any loss of data.
  6. Allows easy integration with blockchain explorers.

Downsides:

  1. Zero spam resistance.
  2. Not a domain structure.
  3. Requires UI to be developed.
  4. Stores data in blockchain.

Specification

Naming service interface contract
Naming service storage contract

NOTE: owner is an address who have permission to change name state. address is the destination of this name. If you are registering name for contract then you should change the address of the name to point at the contract.

IMPORTANT: If you need to get the naming service data, then you need to watch/call the Storage contract.
If you need to make change/interact with naming service data, then you need to call the DexNS contract.

Methods

DexNS contract

registerName

function registerName(string _name) payable returns (bool ok)

Register a new name at Naming Service. msg.sender will become owner and address of this name. metadata will be set to "registered".

addressOf

function addressOf(string _name) constant returns (address _addr)

Returns address of the destination of the name.

ownerOf

function ownerOf(string _name) constant returns (address _owner)

Returns owner of the name.

endtimeOf

function endtimeOf(string _name) constant returns (uint _expires)

Returns timestamp when the name will become free to re-register. Returns 0 for not registered names.

NOTE: endtime is stored at the logical contract. Not in storage. Logic of registering and freeing names is part of logical contract. Storage only accepts calls from it.

updateName

function updateName(string _name, address _addr, string _value) { }
function updateName(string _name, address _addr) { }
function updateName(string _name, string _value) { }

Changes the contents of _name and sets the provided parameters.

appendNameMetadata

 function appendNameMetadata(string _name, string _value)

Adds the provided _value to the end of the already-existing metadata string of the _name.

changeNameOwner

function changeNameOwner(string _name, address _newOwner)

Changes _name owner to _newOwner.

hideNameOwner

function hideNameOwner(string _name, bool _hide)

If _hide is true then ownerOf(_name) will throw whenever called.

Rationale: add possibility to abort execution of transaction/call when someone is trying to interact with name owner from external contract. Address that is associated with each _name is addressOf(_name), not ownerOf(_name) !

assignName

function assignName(string _name)

Assigns _name to msg.sender if sender is an owner of the name.

unassignName

function unassignName(string _name)

Clears _name ussignation if msg.sender is an owner of the name.

extendNameBindingTime

function extendNameBindingTime(string _name) payable

Extends binding time of the _name by constant specified period if sender provided more funds that required to register/update name. (default 0, free names)

Debugging functions (for owner only)

change_Storage_Address

function change_Storage_Address(address _newStorage)

Changes address of the storage to _newStorage.

change_Owner

function change_Owner(address _newOwner)

Changes owner of the contract to _newOwner.

disable_Debug

function disable_Debug()

Disables possibility to debug the contract.

set_Owning_Time

function set_Owning_Time(uint _newOwningTime)

Sets the specified time period for the name binding.

change_Name_Price

function change_Name_Price(uint _newNamePrice)

Sets the specified price for the name registering

Events

Error

event Error(bytes32)

Triggered when error occurs.

NamePriceChanged

event NamePriceChanged(uint indexed _price)

Triggered when price of name is changed by the owner.

OwningTimeChanged

event OwningTimeChanged(uint indexed _period)

Triggered when binding preiod of time is changed by the owner.

DebugDisabled

event DebugDisabled()

Triggered when debug is disabled.

Storage contract

functions that would be called from DexNS contract to modify state

function registerName(string _name) payable returns (bool ok) { }
function updateName(string _name, address _addr, string _value) { }
function updateName(string _name, address _addr) { }
function updateName(string _name, string _value) { }
function appendNameMetadata(string _name, string _value) { }
function changeNameOwner(string _name, address _newOwner) { }
function hideNameOwner(string _name, bool _hide) { }
function assignName(string _name) { }
function unassignName(string _name) { }

functions to return contract data state

addressOf

function addressOf(string _name) constant returns (address _addr)

Returns address of the destination of the name.

ownerOf

function ownerOf(string _name) constant returns (address _owner)

Returns owner of the name.

metadataOf

function metadataOf(string _name) constant returns (string memory _value) 

Returns owner of the name.

assignation

 function assignation(address _assignee) constant returns (string _name)

Returns _name that is currently assigned to _assignee.

name_assignation

function name_assignation(string _name) constant returns (address _assignee)

Returns _assignee address that is currently assigned to _name.

Debugging functions (for owner only)

change_FrontEnd

function change_FrontEnd(address _newFrontEnd)

Changes address of the storage to _newFrontEnd.

change_Owner

function change_Owner(address _newOwner)

Changes owner of the contract to _newOwner.

Events

Error

event Error(bytes32)

Triggered when error occurs.

Metadata specification

Use key flags before data chunks.
-A for ABI.
-L for attached link.
-S for source code reference.

Example of metadata for DexNS contract:
-L https://author.me/ -S https://github.com/source -A [{"constant":false,"inputs":[],"name":"foo","outputs":[],"payable":false,"type":"function"}]

Notes

MyContract / something strange / %20%20%11 are valid names for DexNS. It has no checks for inputs. All names that you can imagine are valid.

It can be a good idea to use versions for testing contracts: MyTest v1.0.0 / MyTest v9.256.122 etc.

@Arachnid

This comment has been minimized.

Collaborator

Arachnid commented Jul 11, 2017

Why introduce another new naming service? Any usability issues for ENS can be handled easily with a suitable Solidity library, and what you're proposing is limited to only the use-cases you can forsee right now; it's not expandable.

@Dexaran

This comment has been minimized.

Dexaran commented Jul 11, 2017

@Arachnid this naming service can be a temporary solution or tool that can make easier interaction with contracts on testnet (for example). Not for the cases when ENS will be used. It can be more convenient for use because of it operates with human-readable values and has an integrated metadata storage (for contract ABI for example).
My experience shows that it is not a common practice to deploy a whole project on testnet before launch (but it will be highly recommended!). I found it important to introduce a more user-friendly version of naming service.
I think it will be nice to have an ability to register your contracts and say: "We deployed a contract on Rinkeby under the name [Test of MyContract]". Some of the not very experienced enthusiasts could participate in the use of this contract without having to look for an ABI or address then.

I don't know if it will be really adopted so I'm asking for feedback.

@Dexaran

This comment has been minimized.

Dexaran commented Jul 11, 2017

You can try it. Here is a web UI: https://dexaran.github.io/nameservice/#interact-contract

You should navigate to "Contracts" tab, click "CONTRACT NAME" and type "DexNS" (without quotes) into large textbox and wait for 3-5 seconds. It will dropdown functions and load address and ABI of the contract automatically.

If you will then switch to the "CONTRACT ABI" tab then you will see ABI and address that were loaded.

I think that it can be useful to have such service at testnets to allow side participants to interact with contracts without requirement to search for ABI.

@sgitt-vassky

This comment has been minimized.

sgitt-vassky commented Jul 14, 2017

As far as I know Ethereum is a fully decentralized community and everyone can set up its own name service. It can be a good idea to have an alternative service. Especially if it is used in other cases than ENS.

@Arachnid

This comment has been minimized.

Collaborator

Arachnid commented Jul 17, 2017

As far as I know Ethereum is a fully decentralized community and everyone can set up its own name service. It can be a good idea to have an alternative service. Especially if it is used in other cases than ENS.

Of course, anyone is welcome to propose or use any naming system they like. And anyone else is welcome to critique it.

Personally, I don't see the value of it over using ENS, and think a proliferation of incompatible standards isn't to anyone's benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment