{"id":18857829,"url":"https://github.com/portalnetwork/bcns","last_synced_at":"2026-01-26T12:14:40.194Z","repository":{"id":112796611,"uuid":"143270126","full_name":"PortalNetwork/bcns","owner":"PortalNetwork","description":"📙🔍 Documents and implementations for the Bitcoin Cash Name Service.","archived":false,"fork":false,"pushed_at":"2018-09-25T14:36:37.000Z","size":6200,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T19:41:41.903Z","etag":null,"topics":["bch","bitcoin-cash","blockchain"],"latest_commit_sha":null,"homepage":"https://bcns.portal.network/","language":null,"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-02T09:06:54.000Z","updated_at":"2019-04-07T02:04:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f00ffe10-6353-448d-a36c-751adab738ae","html_url":"https://github.com/PortalNetwork/bcns","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%2Fbcns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fbcns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fbcns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fbcns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PortalNetwork","download_url":"https://codeload.github.com/PortalNetwork/bcns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239800316,"owners_count":19699119,"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":["bch","bitcoin-cash","blockchain"],"created_at":"2024-11-08T04:08:25.510Z","updated_at":"2026-01-26T12:14:40.148Z","avatar_url":"https://github.com/PortalNetwork.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![Bitcoin Cash Name Service](./assets/cover.png)\n\n\u003e 📙🔍 Documents and implementations for the Bitcoin Cash Name Service.\n\n## 💡 What is Bitcoin Cash?\nBitcoin Cash is an experimental digital currency that enables instant payments to anyone, anywhere in the world. It uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Cash is a descendant of Bitcoin. It became a separate currency from the version supported by Bitcoin Core when the two split on August 1, 2017. Bitcoin Cash and the Bitcoin Core version of Bitcoin share the same transaction history up until the split.\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.bch or ‘mywebsite.eth’ into addresses understandable by decentralized network machines.\n\n## 📝 Description\n\nBCNS is the Bitcoin Cash Name Service, a distributed, open, and extensible naming system based on the Bitcoin Cash blockchain.\nBCNS eliminates the need to copy or type long addresses. With BNS, you'll be able to send token to anyone at 'yourfriend.bch' instead of 'qrd9khmeg4nqag3h5gzu8vjt537pm7le8...', interact with your favorite contract at 'mycontract.bch', or visit an IPFS-hosted site at 'mywebsite.bch’.\n\n## 📖 Technical Overview\n\nBNS is a portable Omni Layer implementation that is based on the Bitcoin ABC codebase. This implementation requires no external dependencies extraneous to Bitcoin ABC, and is native to the Bitcoin Cash network just like other Bitcoin Cash nodes. BNS Layer extensions are exposed via the JSON-RPC interface.\n\n## 📁 Documents\n\n#### Table of Contents\n- [Introduction](./docs/INTRODUCTION.md)\n- [BNS Protocol](./docs/BNS_PROTOCOL.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- [BCNS Stack](./docs/BCNS_STACK.md)\n- [Omni Layer](./docs/OMNI_LAYER.md)\n\n## BCNS Workflow\n\n![BCNS](./assets/BCNS.png)\n\n## 🗂️ BCNS Stack\n\nBitcoin Cash Name Service (BCNS) contains the resolver, registrar, and registry components which governs the rules from how to fairly register the Bitcoin Cash domain name to the content resolving mechanism of each domain. The Bitcoin Cash covenant can be implemented in `OP_RETURN` code, and write and convert the related information through the Omni Layer. Those different layers provides the robust infrastructure to let developers can build decentralized application on top of Bitcoin Cash.\n\n![BCNS Stack](./assets/BCNS-stack.jpg)\n\n### State Layer \n\nBitcoin Cash servers as the fundamental blockchain state layer. It stores each of the transactions and record the related data transformation. This layer give the participants the ability to control and own their state and data. BCNS stores the data and state in the state layer.\n\n![BCNS State Layer](./assets/BCNS-01.jpg)\n\n### Computation Layer\n\nBitcoin Cash Script `OP_RETURN` code :  \nDevelopers can write Bitcoin Cash Script utilizing the `OP_RETURN` code to operate the data and state stores in the State Layer. The group logic set of Bitcoin Cash script is a form of smart contract that exist on a UTXO-based blockchain. The rules determines in the group of logic will restrict the path of money as it passes from output to output. Once the related transactions enter to the smart contract, it’s locked into a specific path and may not under any conditions deviate from that path. The operators who have the ability to create and sign the transactions must create them according to the state of the smart contract.\n\n![BCNS Computation Layer](./assets/BCNS-02.jpg)\n\n### Component Layer\n\nThe design of digital assets can have more functions through combing the State Layer and Computation Layer, such as : crypto assets, and identities. Those programmable assets has many more potential usages and sub-economies within.\nBCNS stand for Bitcoin Cash Name Service, which include three major component:\n- The BCNS registry component can operate the set of logics to record the mapping between the Bitcoin Cash domains and its owners.  \n- The BCNS registrar component can govern how to own a domain through the customized auction or trading rules.\n- The BCNS resolver component can process the mechanism for getting the related representative resources from wallet address to decentralized application or website behind the Bitcoin Cash domain.  \n\nOther components:   \n- Blockchain projects can issue their specific tokens for their own ecosystem, such as : gamings or services.\n- The identity is more than the information binding wallet address. There are like identity containers which can have various information right from the participants, the information of identities may come from different sources, such as governments or trusted parties.\n\n![BCNS Component Layer](./assets/BCNS-03.jpg)\n\n### Scalability / Transfer Layer\n\nOmni Layer is a communication protocol that uses Bitcoin blockchain to implement smart contracts. Omni Layer does not require any external dependencies related to the Bitcoin Cash core. The Omni Layer extension has JSON-RPC interface which the developers can write the information to the UTXO-based blockchain, and get the related information stored in the `OP_RETURN` script.\nBCNS uses Omni Layer to interact with the `OP_RETURN` script and store related BCNS information into Bitcoin Cash blockchain.\n\n![BCNS Transfer Layer](./assets/BCNS-04.jpg)\n\n### Protocol Layer \n\n#### BNS protocol\nThe BNS protocol is a standard which can make the Bitcoin Cash name service more efficient. The protocol essentially for the user control layer and the application layer which can let more applications and services can be built on top of it. \n\n![BCNS Protocol Layer](./assets/BCNS-05.jpg)\n\n### User Control Layer \n\nThis layer is in charge of managing a user’s private keys and the interaction with the State Layer. Before the Bitcoin.com and BCH wallet published, the users should use command line interface (CLI) to talk directly with the computation layer. BCNS plays an crucial rule to transfer hashes to human-meaningful names. BCH wallet and browser extension can resolution BCNS to wallet address, contract address and IPFS hash.\n\n![BCNS User Control Layer](./assets/BCNS-06.jpg)\n![BCNS User Control Layer](./assets/BCNS-08.jpg)\n\n### Application Layer \n\nThe above features provided by different layers enables more real use cases. For example, developers can utilize the tech stacks to build a decentralized website which can interact with the Bitcoin Cash and hosted on IPFS. Users can view the decentralized resources through simply typing `yourproject.bch` on the domain url bar with our further enhancement in browser extension. \n\n![BCNS Application Layer](./assets/BCNS-07.jpg)\n\n## 📚 BCNS Spec\n\n### Transaction Field Definitions\n\nThis section defines the fields that are used to construct transaction messages.\n\n#### Field: Ecosystem\n- Description: Specifies the ecosystem of BCNS\n- Size: 8-bit unsigned integer, 1 byte\n- Valid values: 1\n\n#### Field: Integer-one byte\n- Description: used as a multiplier or in other calculations\n- Size: 8-bit unsigned integer, 1 byte\n- Valid values: 0 to 255\n\n#### Field: UTC Datetime\n- Description: Datetime, assuming UTC timezone (the same timezone used by the bitcoin blockchain)\n- Size: 64-bits standard unix timestamp, 8 bytes (note: seconds, not milliseconds)\n\n#### Field: Property type\n- Description: Specifies the type of BCNS.\n- Size: 8-bit unsigned integer, 1 byte\n- Valid values:\n    - 1: Domain name is available\n    - 3: Domain name is taken and currently owned by someone\n    - 4: Domain name is forbidden\n\n#### Field: Bitcoin Address\n- Description: the 21 bytes needed to uniquely identify a bitcoin address\n- Size: 21 bytes, binary data\n- Valid values: any 21 bytes (version + output of RIPEMD-160 hash step of creating a bitcoin address)\n\n#### Field: Transaction version\n- Description: Description: the version of the transaction definition, monotonically increasing independently for each transaction type\n- Size: 16-bit unsigned integer, 2 bytes\n- Required/optional: Required\n- Valid values: 0 to 65535\n\n#### Field: Transaction type\n- Description: the MSC Protocol function to be performed\n- Size: 16-bit unsigned integer, 2 bytes\n- Current Valid values:\n    - 0: Register a domain\n    - 30: Set domain owner\n    - 31: Create BCNS subdomain\n    - 32: Set domain resolver\n    - 33: Set domain time to leave\n    - 50: Set address associate with domain\n    - 51: Set content associate with domain\n    - 52: Set multihash associate with domain\n    - 53: Set name associate with domain\n    - 54: Set text associate with domain(key-value pair)\n\n## What is Omni Layer?\nOmni Layer is a communication protocol that uses Bitcoin blockchain to implement smart contracts. Omni Core is a fast, portable Omni layer implementation based on the Bitcoin core code base. Omni Layer does not require external dependencies that are not related to Bitcoin Core, and like other Bitcoin nodes, it is itself a bitcoin network. The Omni Layer extension is exposed through the JSON-RPC interface.\n\n### Dependency\n\nLibrary     | Purpose          | Description\n------------|------------------|--------------------\nlibssl      | Crypto           | Random number generation, encrypt by Elliptic curve cryptography \nlibboost    | Utility          | Thread, data structure\nlibevent    | Networking       | Independent network of the operating system\nminiupnpc   | UPnP Support     | Across the firewall\nlibdb4.8    | Berkeley DB      | Storage (only needed when wallet enabled)\nqt          | GUI              | GUI toolkit (only needed when GUI enabled)\nprotobuf    | Payments in GUI  | Data exchange format in payment protocol (only needed when GUI enabled)\nlibqrencode | QR codes in GUI  | Generate QR code (only required when GUI enabled)\nunivalue    | Utility          | JSON parsing and generation (bundled version will be used unless –with-system-univalue passed to configure)\nlibzmq3     | ZMQ notification | Generate zmq messages (ZMQ, ZeroMQ, message queue)\n\n#### Memory requirement\nThe C++ compiler consumes more memory, and the official recommendation is to have at least 1.5GB of memory when compiling Bitcoin Core.\n\n```\n./configure CXXFLAGS=\"--param ggc-min-expand=1 --param ggc-min-heapsize=32768\"\n```\n\n### Install \n\nSince we need to use `apt` installation, first make sure apt source is available\n```\nsudo apt-get update\n```\n![Omni Step 1](./assets/omni1.png)\n\n#### Install basic environment\n```\nsudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils\n```\n![Omni Step 2](./assets/omni2.png)\n\n#### Install boost library\n```\nsudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev\n```\n![Omni Step 3](./assets/omni3.png)\n\n#### Install BerkeleyDB \nBitcoin requires BerkeleyDB 4.8 to maintain wallet compatibility. The official Ubuntu and Debian Berkeley DB is 5.1+. This high version is determined to break its compatibility.\n```\nsudo apt-get install software-properties-common\nsudo add-apt-repository ppa:bitcoin/bitcoin\nsudo apt-get update\nsudo apt-get install libdb4.8-dev libdb4.8++-dev\nsudo apt-get install libdb-dev\nsudo apt-get install libdb++-dev\n```\n![Omni Step 4](./assets/omni4.png)\n\n#### Install GUI dependency\n\nIf you need to compile `bitcoin-qt`, you need to install qt development environment, qt4 and qt5 are all possible. If both are installed, qt5 is used by default. You can also use `--with-gui=qt4` during configuration. Choose to use the qt4 version, or use `--without-gui` to choose not to compile the gui.\n```\nsudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler\n```\n\n#### Compile\n```\ngit clone https://github.com/OmniLayer/omnicore.git\ncd omnicore/\n./autogen.sh\n./configure\n./configure CXXFLAGS=\"--param ggc-min-expand=1 --param ggc-min-heapsize=32768\" # optional\nmake\n```\n![Omni final](./assets/omni5.png)\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%2Fbcns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportalnetwork%2Fbcns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportalnetwork%2Fbcns/lists"}