How to programming with CryptoName

Introduction

CryptoName is a personal name storage business card based on elastos side chain. It enables the user to store their public profile info within it. If you know the CryptoName you can access the info stored within. The CryptoName info is the public profile of the user.

The storage structure of CryptoName is like a Key/Value storage. The user can set a keyword as the Key, and at the same time input the value as its content.

So if others, including apps, want to access some info of the user, you can access them by using the keywords.

By default, the CryptoName has included "btc.address", "eth.address", "ela.address", usdt.address, "did", and "publickey" keywords. If you need more fields on CryptoName, you can ask the user to set it. We support 50 fields within the CryptoName.

The user can edit their "profile" on https://CryptoName.org, it's very simple.

If you want to help the user to set their CryptoName, you need to support a standard Web3 provider in your app, and it also needs to support the elastos side chain wallet.

 

Interface

APIs and Library

Contract address:

ABI file:

JS file:

Sample:

npm install:

Sample:

 

How to access the CryptName?

Method 1: Get the json of profile

Example:

Http Get: https://ABCD.elastos.name/info.json

Response:

 

Method 2: Import the js file in your html files

Example:

Below JS object will be imported to your window:

 

Method 3: Get the value of via a key

Example:

Http Get: https://ABCD.elastos.name/ela.address

Response:

https://ABCD.elastos.name/publickey

Response:

 

Method 4: Using npm

 

 

Use Cases

Case 1: The crypto wallet can support users to send assets via the CryptoName.

*The elephant wallet already supports CryptoName, you can send crypto assets to your friends by simply inserting their CryptoName in the address bar.

Case 2: Chat App's can support CryptoName, of which enables the user to search and add friends.

 

Case 3: You can bind your DID with your CryptoName, this makes it simple for others to use.

 

Case 4: You can bind your IP address with a CryptoName, that's your own Domain Name.

 

Case 5: If you are a well known person or a company, you can make public your Email using your CryptoName.