Skip to content

Latest commit

 

History

History
191 lines (122 loc) · 5.2 KB

OEP-7.mediawiki

File metadata and controls

191 lines (122 loc) · 5.2 KB

  OEP: 7
  Title: URI Schema Standard
  Author:  zhoupw <zhoupw@gmail.com>
  Type: Standard
  Status: Active
  Created: 2018-10-22

Table of Contents

Abstract

The OEP-7 Proposal is a standard interface of URI schema, this standard allows for the implementation of mapping ontology DID to readable URI.

Motivation

1. This OEP is used for user to register a meaningful and special domain using his ONTID. 2. User can bind any values(not only the wallet address) to this domain. 3. Frontend Apps can analyze the value from the domain by it's business logic. 4. Every domain has different levels and valid period.

Specification

Methods

registerDomain

def registerDomain(fulldomain, registerdid,idx, validto)
This allows user to register a domain ,like standard URL, domain format can be *.a.ont, only contract admin can register the top level domain, top domain owner can register the sub level domain and this should trigger a "registerDomain" event.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters. The parameter registerdid is user's ONTID and the idx is user's wallet index of the ONTID. The parameter idx is the wallet index of registerdid. The parameter validto is time stamp for the domain expiration.

updateValidPeriod

def updateValidPeriod(fulldomain,idx,validto)
Update the domain's valid period by parent owner,this should trigger a 'updateValidPeriod' event.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters. The parameter idx is the wallet index of registerdid. The parameter validto is time stamp for the domain expiration.

deleteDomain

def deleteDomain(fulldomain,idx)

Delete the domain,this should trigger a 'deleteDomain' event.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters. The parameter idx is the wallet index of registerdid.

bindValue

def bindValue(fulldomain,idx, ctype,inputvalue)

Bind a value to the domain,this should trigger a 'bindValue' event.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.. The parameter idx is the wallet index of registerdid. The parameter ctype is value type. The parameter inputvalue is value to bind.

transfer

def transfer(fulldomain,idx,todid)

Transfer domain to other did, this should be only called by URI owner.

The parameter address must be a 20-byte address. If not, this method must throw an exception.

transfer

def transfer(fulldomain,idx,todid)
Transfer domain to other did, this should be only called by URI owner. Note: transfer will not change the valid time of the domain.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters. The parameter idx is the wallet index of registerdid. The parameter todid is the receiver did.

valueOf

def valueOf(fulldomain)

Returns the bind value domain.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.

validTo

def validTo(fulldomain)

Returns the valid period of the domain.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.

ownerOf

def ownerOf(fulldomain)

Returns the owner DID of the domain.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.

isDomainValid

def isDomainValid(fulldomain)

Return true if the domain is valid.

The parameter fulldomain should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.

getDomains

def getDomains(did)

Return the domains binded to the DID.

Events

transfer

RegisterAction("transfer","domain","from","to")

The event must be triggered when tokens are transferred.

registerDomain

RegisterAction("registerDomain", "domain", "owner","validTo")

The event must be triggered on any successful calls to register.

updateValidPeriod

RegisterAction("updateValidPeriod","domain","newvalid")

The event must be triggered on any successful calls to updateValidPeriod.

bindValue

RegisterAction("bindValue","domain","ctype","value")

The event must be triggered on any successful calls to bindValue.

deleteDomain

RegisterAction("deleteDomain","domain")

The event must be triggered on any successful calls to deleteDomain.

Implementation

Python sample Python Template