Announcing the $NEO Name Service (NNS) Javascript SDK!

Jun 24, 2024 2:09:52 PM

Announcing the Neo Name Service (NNS) Javascript SDK Release

We are pleased to announce the release of the Neo Name Service (NNS) SDK. NNS is the native name service for the Neo blockchain, allowing users to mint names ending in .neo as NFTs.

The SDK simplifies NNS smart contract interactions, making it easier for developers to integrate human-readable names into their applications.

The SDK is open-source, and the repository can be accessed here.

Importance of Name Services

Human-readable names simplify blockchain interactions, replacing complex addresses with memorable names. This enhances accessibility, similar to how domain names simplify internet usage by replacing IP addresses.

Name services enhance the user experience, making blockchain applications more user-friendly and intuitive.

Project Structure

The SDK is built around two main classes:

  • Client Class: Provides straightforward methods for basic operations such as querying a domain name’s owner or checking name availability.
  • Transaction Builder Class: This class offers advanced functionality for constructing and managing complex transactions, providing more control over NNS smart contract interactions.

Key Features

The Neo Name Service SDK includes:

  • Address Resolution: Resolve human-readable names to Neo blockchain addresses.
  • Name Registration: Register and transfer names on the Neo blockchain.
  • Record Management: Add, update, and delete records associated with a name.
  • Transaction Building: Construct and manage transactions for NNS smart contract interaction.

Developers can access all NNS features and perform various operations with ease.

Addressing GAS Inflation

The Neo Name Service contract burns the GAS used in name registration and renewal, mitigating GAS inflation by reducing the overall supply. The amount of GAS burned depends on the name’s length and registration duration. Three-letter names cost 200 GAS, four-letter names cost 70 GAS, and five-letter names cost 2 GAS.

This mechanism helps maintain the stability of the Neo blockchain, ensuring GAS remains valuable and sustainable.

Installation and Usage

Install the NNS SDK via NPM:

To query the owner of a domain name:

Integrating NNS Purchases

The SDK allows easy integration of NNS purchases into applications, enabling users to acquire domain names directly within applications. Compatible with Neon DappKit, it supports front-end applications, allowing users to purchase NNS names with a few clicks.

Neon DappKit is a JavaScript library built by COZ that simplifies the integration of Neo blockchain functionality into web applications.

It provides a user-friendly interface for interacting with Neo blockchain smart contracts. Internally, the NNS SDK uses Neon DappKit to interact with the Neo blockchain.

Conclusion

The Neo Name Service SDK enhances the application user experience by integrating human-readable names into blockchain interactions. It simplifies NNS smart contract interactions, helping developers build user-friendly applications on the Neo blockchain.

If we consider the GAS burning mechanism, the SDK also contributes to the Neo ecosystem’s sustainability by incentivizing Neo Name Service usage.

If you have any questions or need assistance, please join our Discord community. We look forward to seeing the applications you build with the new SDK!

Do you have an idea for an app in the NEO ecosystem but don’t know where to start? Our team of experts can help. Contact us at contact@linkd.academy.