{"id":18857769,"url":"https://github.com/portalnetwork/nem-ns","last_synced_at":"2026-06-17T21:01:45.943Z","repository":{"id":112797744,"uuid":"145949015","full_name":"PortalNetwork/nem-ns","owner":"PortalNetwork","description":"🌐 Documents and implementations for the NEM Name Service.","archived":false,"fork":false,"pushed_at":"2018-11-02T12:07:28.000Z","size":7367,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T19:39:18.387Z","etag":null,"topics":["blockchain","nem","nns"],"latest_commit_sha":null,"homepage":"https://nem.portal.network/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PortalNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-24T06:02:15.000Z","updated_at":"2018-11-02T12:07:30.000Z","dependencies_parsed_at":"2023-04-20T19:05:48.394Z","dependency_job_id":null,"html_url":"https://github.com/PortalNetwork/nem-ns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fnem-ns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fnem-ns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fnem-ns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fnem-ns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PortalNetwork","download_url":"https://codeload.github.com/PortalNetwork/nem-ns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239799564,"owners_count":19699076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","nem","nns"],"created_at":"2024-11-08T04:08:06.115Z","updated_at":"2026-02-07T06:30:17.309Z","avatar_url":"https://github.com/PortalNetwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NEM Name Service](./assets/title.jpg)\n\n\u003e 📖🔍 Documents of the NEM Name Service.\n\n# Overview\n\n## 💡 What is NEM?\nNEM is the world’s first \"Smart Asset\" blockchain. Built with businesses in mind, NEM is a world class platform designed to offer a streamlined method to maintain a secure ledger of transactions.\n\nNEM’s blockchain technology offers the potential to drastically simplify an enormous variety of secure ledger and transaction tracking systems. It provides an adaptable API interface that can be used with any programming language.\n\nDesigned with modular customization in mind, NEM can be used for almost any application thanks to its \"Smart Asset System\". \n\n## 💡 What is BNS?\nBNS – or blockchain name system – is the protocol on the internet that turns human-comprehensible decentralized website names such as ‘website.xem’ or ‘mywebsite.xem’ into addresses understandable by decentralized network machines.\n\n## 📝 Description\n\nNNS is the NEM Name Service, a distributed, open, and extensible naming system based on the NEM blockchain.\n\n## 📚 Documents\n\n#### Table of Contents\n- [Introduction](./docs/INTRODUCTION.md)\n- [Implementation](./docs/IMPLEMENTATION.md)\n    - [Registry](./docs/REGISTRY.md)\n    - [Registrar](./docs/REGISTRAR.md)\n    - [Resolver](./docs/RESOLVER.md)\n- [Integration](./docs/INTEGRATION.md)\n    - [Docker Setup](./docs/NEM_DEV_DOCKER.md)\n\n## NEM in Web3.0\nNEM Name Service plays an connecting and entry layer in Web3.0 services. It connects with NEM wallet, blockchain server, decentralized content resources, and decentralized database. \n![Web3](./assets/Web3.png)\n\n## NEM Technical Stack\nNEM Name Service (NEM-NS) is governed by three smart assets components, registrar, registry, and resolver. The three smart assets contain the core logic for the NEM Name Service implementation, from the ownership managment for a domain, to the global resolving layer that is reposible for connecting different tech stacks and enhances the usability for different infrastructures. These layers structure starts from top to bottom along the y-axis, and will be explained in the following sections.\n![NEM Tech Stack](./assets/NEM-stack.png)\n\n### State Layer\nState layer is where user’s “state”, or user’s information and behavior, is stored. NEM is where these data are stored, and gives users the ability to control their own state. And from hereon every layer is built on or is compatible with the layers below it.\n![NEM State](./assets/NEM-state.png)\n\n### Computation Layer\nNEM uses its smart asset in its computation layer, which is responsible for executing complicated calculations. And by giving users direct API access to a specialized set of tested and secure on-blockchain features, Portal Network will be deploying NEM-NS (Smart Asset Standard) on this layer that consists 3 major components. \n![NEM Computation](./assets/NEM-computation.png)\n\n### Component Layer\nThe component layer can provide more functions to the smart assets by combing the State Layer and Computation Layer (ie. crypto assets, identity, cryptocurrency). In the case of NEM-NS, we will consist three abstract components which are `registrar`, `registry`, and `resolver` in order to modularize the whole NEM Name service into three pieces. These three main smart contracts components represent the three responsibilities for the best practice of the current naming system.\n\nThe `registry` stores a list of every domain (and subdomain, and sub-sub-domain, and so forth) and the related ownership information. The `registrar` governs the registering process for the specific domain. The mechanism design for the process should consider how to prevent the collusion and economical efficiency. The `resolver` is in charge of resolving the universal mapping logic from wallet address, contract address, decentralized content address, and many more.\n![NEM Component](./assets/NEM-component.png)\n\n### Protocol Layer\nNEM Name Service can utilize the BNS protocol to modularize the business logic and provide the well-designed interfaces to let other services easily integrated with. It is a gateway for developers to connect different layers and increase more business capacity, enhance the usability and reduce the complexity.\n![NEM Protocol](./assets/NEM-protocol.png)\n\n### User Control Layer\nUser control layer is in charge of managing private keys to communicate with the state layer. NEM-NS empowers users to control, set up and manage their digital asset with an easier and readable text, which could be further utilized in the next application layer. \n![NEM User](./assets/NEM-user.png)\n\n### Application Layer\nThe above components provided by different layers unleashes more real business opportunities. For example, wallet that can resolve NEM-NS, dApp that utilize NEM-NS for users identity and more. All of these allow users to view and access the decentralized resources through simple names like `identity.nem`.\n![NEM Application](./assets/NEM-app.png)\n\n# Introduction\n\n## NEM NIS Docker node setup\n\n### NIS - NEM Infrastructure Server\nThe NEM Infrastructure Server (short: NIS) was written in Java. It allows you interact with NEM.\n\n### Get start\nFor rapid development, NEM officialy offers a helper script file to automatically deploy docker container. If you insist on setup docker manually, here is [reference](https://blog.nem.io/nem-docker/). Below is tutorial of using helper script:\n\n1. Download script first\n```\nmkdir nem-dev\ncd nem-dev\ncurl -q https://raw.githubusercontent.com/rb2nem/nem-dev-guide/master/docker/ndev \u003e ndev\nchmod +x ndev\n```\n\n2. Execute script\n```\n$ ./ndev\n```\n\nThe first time you run the script, it will:\n\n- check if its `settings.sh` file exists, and create it if needed. The user is prompted for values to be provided.\n- check if the required docker-compose.yml file is present, and download it from github if needed\n- Download docker images from the DockerHub\n\nTo check that the containers are running:\n```\n$ ./ndev --status\n```\n\nIt will print:\n```\nrunning containers are:\nnem-dev_nemdevnis_1\nnem-dev_nemdevtools_1\n```\n\nAnd open a shell in the NIS container: \n```\n$ ./ndev -c nis bash\n```\nIn container shell, check if NIS is running:\n```\n[root@23627cb63be0 /]# ps aux \nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot         1  0.4  0.0  18240  3332 ?        Ss   13:09   0:00 bash\nroot        18  0.1  0.4  56200 15436 ?        Ss   13:09   0:00 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf\nnem         23  305  8.3 3608648 320760 ?      Sl   13:09   0:15 java -Xms512M -Xmx1G -cp .:./*:../libs/* org.nem.deploy.CommonStarter\nroot        41  0.0  0.0  34424  2784 ?        R+   13:09   0:00 ps aux\n```\nThis shows that NIS is running (this is the java -Xms512M -Xmx1G ... process).\n\nIf not, type below command:\n```\n[root@23627cb63be0 /]# supervisorctl start nis\n```\nYou can access the logs of NIS with `tail /var/log/nis-stderr.log -f`:\n```\n[root@23627cb63be0 /]# tail /var/log/nis-stderr.log -f\n2018-09-14 10:18:35.670 INFO synchronizing with Node [TBR2PTTGTINUOW5ENEXYWPIITRJ6XTVVZNYNUCMP \u003cTBR2PTTGTINUOW5ENEXYWPIITRJ6XTVVZNYNUCMP\u003e] @ [80.240.29.150] finished (org.nem.peer.services.NodeSynchronizer b)\n2018-09-14 10:18:38.672 INFO synchronizing with Node [Hi, I am MedAlice2 \u003cTALIC37AGCDGQIBK3Y2IPFHSRAJ4HLJPNJDTSTJ7\u003e] @ [23.228.67.85] (org.nem.peer.services.NodeSynchronizer b)\n2018-09-14 10:18:44.777 INFO received 400 blocks (12 transactions) in 4786 ms from remote (398833 ?s/tx) (org.nem.nis.sync.BlockChainUpdater c)\n2018-09-14 10:18:44.908 INFO clustering completed: { clusters: 2 (average size: 10.50), hubs: 0, outliers: 523 } (org.nem.nis.pox.poi.PoiContext$AccountProcessor dh)\n2018-09-14 10:18:44.910 INFO Iterations required: 6; converged?: true (org.nem.nis.cx.na.qcw run)\n2018-09-14 10:18:44.911 INFO POI iterator needed 2ms. (org.nem.nis.pox.poi.PoiImportanceCalculator c)\n2018-09-14 10:18:45.110 INFO validated 400 blocks (12 transactions) in 327 ms (27250 ?s/tx) (org.nem.nis.sync.BlockChainUpdateContext fz)\n2018-09-14 10:18:45.111 INFO new block's score: 11226358709252895 (org.nem.nis.sync.BlockChainUpdateContext a)\n2018-09-14 10:18:45.611 INFO chain update of 400 blocks (12 transactions) needed 499 ms (41583 ?s/tx) (org.nem.nis.sync.BlockChainUpdateContext fz)\n2018-09-14 10:18:45.619 INFO synchronizing with Node [Hi, I am MedAlice2 \u003cTALIC37AGCDGQIBK3Y2IPFHSRAJ4HLJPNJDTSTJ7\u003e] @ [23.228.67.85] finished (org.nem.peer.services.NodeSynchronizer b)\n2018-09-14 10:18:48.622 INFO synchronizing with Node [do-nem \u003cTBQWT47B5GHLSGKX7CMKNPDAX2DA6MNQ7HZ3ATSI\u003e] @ [178.62.61.222] (org.nem.peer.services.NodeSynchronizer b)\n2018-09-14 10:18:51.583 INFO received 400 blocks (4 transactions) in 887 ms from remote (221750 ?s/tx) (org.nem.nis.sync.Blo\n```\n\nIf you see that the NIS instance is communicating with other instances (synchronizing with Node [Hi, I am MedAlice2...) which means our NIS instance is synchronized ongoing. You can start to interact with NEM through [NEM-SDK](https://github.com/QuantumMechanics/NEM-sdk) now.\n\n## 📣 Contributing\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for how to help out.\n\n## 🗒 Licence\nSee [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportalnetwork%2Fnem-ns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportalnetwork%2Fnem-ns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportalnetwork%2Fnem-ns/lists"}