{"id":31745023,"url":"https://github.com/dotbithq/did-contracts","last_synced_at":"2025-10-09T12:28:51.585Z","repository":{"id":43671355,"uuid":"323254485","full_name":"dotbitHQ/did-contracts","owner":"dotbitHQ","description":"This is the repository for contract scripts and development documents of DID.","archived":false,"fork":false,"pushed_at":"2025-03-20T07:08:33.000Z","size":6258,"stargazers_count":45,"open_issues_count":1,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-20T07:31:44.404Z","etag":null,"topics":["blockchain","iterable","rust"],"latest_commit_sha":null,"homepage":"https://d.id","language":"Rust","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/dotbitHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"Audit Report - by Least Authority.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-21T06:50:25.000Z","updated_at":"2025-03-20T07:08:39.000Z","dependencies_parsed_at":"2024-06-09T16:33:54.362Z","dependency_job_id":"c7bacf37-1b91-4acc-bd48-08d48cbca819","html_url":"https://github.com/dotbitHQ/did-contracts","commit_stats":null,"previous_names":["dotbithq/did-contracts","dotbithq/das-contracts"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dotbitHQ/did-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdid-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdid-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdid-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdid-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotbitHQ","download_url":"https://codeload.github.com/dotbitHQ/did-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdid-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001445,"owners_count":26083078,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","iterable","rust"],"created_at":"2025-10-09T12:28:28.253Z","updated_at":"2025-10-09T12:28:51.576Z","avatar_url":"https://github.com/dotbitHQ.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# did-contracts\n\n![Version](https://img.shields.io/github/release/dotbitHQ/did-contracts.svg)\n![License](https://img.shields.io/github/license/dotbitHQ/did-contracts.svg)\n[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge\u0026logo=discord\u0026logoColor=white)](https://discord.com/invite/did)\n[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white)](https://x.com/intent/follow?screen_name=DIDbased)\n\nThis repository is open source for DID contracts which also called \"type script\" in CKB. They can only execute in [ckb-vm](https://github.com/nervosnetwork/ckb-vm) environment which a pure software implementation of the RISC-V instruction set.\n\n\n## About DID\n\nDID is a blockchain-based, open source, censorship-resistant decentralized account system that provides a globally unique naming system with a .bit suffix that can be used for cryptocurrency transfers, domain name resolution, authentication, and other scenarios.\n\nNow DID has been deployed on CKB mainnet which named **Lina** and launched from **2021-07-22** 🎉 .\n\n## Development\n\n### Prerequisites\n\nMake sure you have installed all the following prerequisites on your development machine:\n- Docker - [Install Docker](https://docs.docker.com/engine/install/).\n- Rust - [Install Rust](https://www.rust-lang.org/tools/install) and its [nightly toolchain](https://rust-lang.github.io/rustup/concepts/toolchains.html)\n\n- Install `build-essential` if you are using Linux, install `xcode-select --install` if you are using MacOS;\n- Install `pkg-config libssl-dev` to make openssl available as dependency if you are using Ubuntu, other Linux distributions may also need to do something similar.\n\n\n### How to compile\n\nTo compile scripts on your own is the first step to start developing scripts, but it always causes headache problems when we're facing problems about dependencies.\nSo here we choose a simple solution provided by Nervos team - using Docker. With an image named `dotbitteam/ckb-dev-all-in-one:0.0.1` which contains all dependencies\nfor compiling scripts, anyone can start compiling in about half an hour, and the most time cost will be waiting for downloading.\n\n\u003e ⚠️ Linux and x86 is recommended to do the compiling task, otherwise you may face various problems cause by both system and chipset.\n\n- Pull the compiling image with `docker pull dotbitteam/ckb-dev-all-in-one:0.0.1`;\n\nNow you can start compiling scripts by yourself! 🚀\n\n### Compiling commands\n\nFirst you need to start container with `./docker.sh start -b`, then you can try commands below:\n\n- `./docker.sh build xxx-cell-type --dev` compiling a specific script for development environment, it can be\n  also `--dev, --testnet, --mainnet`;\n- `./docker.sh build-all --dev` compiling all scripts for development environment;\n- `./docker.sh build xxx-cell-type --release --dev` compiling a specific script with release profile, but still for development environment;\n- `./docker.sh build-all --release --dev` compiling all scripts with release profile, but still for development environment;\n\n\u003e ⚠️ `./docker.sh` is a very simple script which can not handle arguments in different order, so remember keep all arguments as the same\n\u003e order as above otherwise it may not work properly.\n\n\u003e When executing `build-all` sub-command, `test-env, test-custom-script` and `playground` scripts will not be compiled. You need to compile\n\u003e them one by one with `build` sub-command.\n\n### Unit tests\n\nAll tests are divided into two categories:\n\n- tests start with `test_`, these are basic tests for simply debugging contracts, there is no error in any of these tests.\n- tests start with `challenge_`, these are boundary condition tests that a specific error code must be returned.\n\nThe prefix is design for running different categories of tests separately:\n\n```bash\n./docker.sh test-release test_ # all the tests start with test_ are normal tests\n./docker.sh test-release challenge_ # all the tests start with challenge_ are abnormal tests\n```\n\nAll tests will be executed with the above commands, but if any test fails, it is possible to get the detailed runtime log with the following command:\n\n```bash\n./docker.sh test-debug test_config_account_loading\n```\n\n### Documents\n\n- For details about price, preserved accounts and so on, please see: https://community.d.id/c/knowledge-base-bit/\n- To learn more about data structures, protocols and other technical details, please see documents in [docs/](https://github.com/dotbitHQ/did-contracts/tree/docs/docs) directory of this repository.\n- It's a good idea to start with their RFCs to learn more about all aspects of CKB: https://github.com/nervosnetwork/rfcs\n- Other things may help you a lot when develop contracts:\n  - CKB VM Error Codes: https://github.com/nervosnetwork/ckb-system-scripts/wiki/Error-codes\n  - CKB JSON-RPC Protocols: https://github.com/nervosnetwork/ckb/tree/develop/rpc\n\n\n## Audit Report\n\nThe contracts were audited by [Least Authority](https://leastauthority.com/) on April 10, 2024. You can find the reports in the [**Audit Report - by Least Authority.pdf**](https://github.com/dotbitHQ/did-contracts/blob/master/Audit%20Report%20-%20by%20Least%20Authority.pdf) file.\n\n\n## License\n\nThis repository is released under the terms of the MIT license. See [LICENSE](LICENSE) for more information or see https://choosealicense.com/licenses/mit/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fdid-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotbithq%2Fdid-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fdid-contracts/lists"}