{"id":27061700,"url":"https://github.com/duanyytop/ckb-cheque-script","last_synced_at":"2025-07-21T12:39:34.882Z","repository":{"id":48983212,"uuid":"316479289","full_name":"duanyytop/ckb-cheque-script","owner":"duanyytop","description":"The lock script of cheque cell on Nervos CKB","archived":false,"fork":false,"pushed_at":"2021-07-02T07:36:59.000Z","size":5311,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T14:32:42.816Z","etag":null,"topics":["capsule","cheque","ckb","lock","script"],"latest_commit_sha":null,"homepage":"","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/duanyytop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-27T11:10:34.000Z","updated_at":"2021-07-02T07:37:05.000Z","dependencies_parsed_at":"2022-09-07T16:03:33.922Z","dependency_job_id":null,"html_url":"https://github.com/duanyytop/ckb-cheque-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/duanyytop/ckb-cheque-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanyytop%2Fckb-cheque-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanyytop%2Fckb-cheque-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanyytop%2Fckb-cheque-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanyytop%2Fckb-cheque-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duanyytop","download_url":"https://codeload.github.com/duanyytop/ckb-cheque-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanyytop%2Fckb-cheque-script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266303649,"owners_count":23908373,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["capsule","cheque","ckb","lock","script"],"created_at":"2025-04-05T14:27:51.835Z","updated_at":"2025-07-21T12:39:34.855Z","avatar_url":"https://github.com/duanyytop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ckb-cheque-script\n\n[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/nervosnetwork/ckb-cheque-script/blob/main/COPYING)\n[![Github Actions CI](https://github.com/nervosnetwork/ckb-cheque-script/workflows/CI/badge.svg?branch=main)](https://github.com/nervosnetwork/ckb-cheque-script/actions)\n\nThe lock script of cheque cell on Nervos CKB using [Capsule](https://github.com/nervosnetwork/capsule)\n\n### Pre-requirement\n\n- [capsule](https://github.com/nervosnetwork/capsule) \u003e= 0.4.3\n- [ckb-cli](https://github.com/nervosnetwork/ckb-cli) \u003e= 0.35.0\n\n\u003e Note: Capsule uses docker to build contracts and run tests. https://docs.docker.com/get-docker/\n\u003e and docker and ckb-cli must be accessible in the PATH in order for them to be used by Capsule.\n\n### Getting Started\n\n- Init submodules:\n\n```\ngit submodule init \u0026\u0026 git submodule update -r --init\n```\n\n- Generator static linking for secp256k1:\n\n```\ncd contracts/ckb-cheque-script/ckb-lib-secp256k1/ckb-production-scripts\ngit submodule init \u0026\u0026 git submodule update\ncd .. \u0026\u0026 make all-via-docker\n```\n\n- Build contracts:\n\n```sh\n# back to repo root directory\ncd ../../..\ncapsule build\n```\n\n- Run tests\n\n```sh\ncapsule test\n```\n\n### Deployment\n\n#### 1. Update the deployment configurations\n\nOpen `deployment.toml` :\n\n- cells describes which cells to be deployed.\n\n  - `name`: Define the reference name used in the deployment configuration.\n  - `enable_type_id` : If it is set to true means create a type_id for the cell.\n  - `location` : Define the script binary path.\n  - `dep_groups` describes which dep_groups to be created. Dep Group is a cell which bundles several cells as its members. When a dep group cell is used in cell_deps, it has the same effect as adding all its members into cell_deps. In our case, we don’t need dep_groups.\n\n- `lock` describes the lock field of the new deployed cells.It is recommended to set lock to the address(an address that you can unlock) of deployer in the dev chain and in the testnet, which is easier to update the script.\n\n#### 2. Build release version of the script\n\nThe release version of script doesn’t include debug symbols which makes the size smaller.\n\n```sh\ncapsule build --release\n```\n\n#### 3. Deploy the script\n\n```sh\ncapsule deploy --address \u003cckt1....\u003e --fee 0.001\n```\n\nIf the `ckb-cli` has been installed and `dev-chain` RPC is connectable, you will see the deployment plan:\n\nnew_occupied_capacity and total_occupied_capacity refer how much CKB to store cells and data.\ntxs_fee_capacity refers how much CKB to pay the transaction fee.\n\n```\nDeployment plan:\n---\nmigrated_capacity: 0.0 (CKB)\nnew_occupied_capacity: 129352.0 (CKB)\ntxs_fee_capacity: 0.003 (CKB)\ntotal_occupied_capacity: 129352.0 (CKB)\nrecipe:\n  cells:\n    - name: ckb-cheque-script\n      index: 0\n      tx_hash: \"0x56353f036c04b153eaa6ef31a8637fb673b255fa62becf1c253b00aace643ae1\"\n      occupied_capacity: 58414.0 (CKB)\n      data_hash: \"0x617bfa9727d99fbc094a485d14842128f4224260b62278412f44cf2951e512ba\"\n      type_id: \"0x17340bcdef33d40b0ddaeb1a2f5152f579c7e08088977dfb600abf44049ff173\"\n    - name: secp256k1_blake2b_sighash_all_dual\n      index: 0\n      tx_hash: \"0xf15d81696d1e2fd9e1e128ca95fb8ee3263e04961323ca1e74b8809cb4529828\"\n      occupied_capacity: 70765.0 (CKB)\n      data_hash: \"0xa01d57f854cc965cd8850c06691d666f933d8389d693266273bd6c47753cf447\"\n      type_id: ~\n  dep_groups:\n    - name: dep_group\n      tx_hash: \"0x2ebd890517f1a54f5f1a0084bd2111203266d6c321b190232f3ceaa322ef7fd5\"\n      index: 0\n      occupied_capacity: 173.0 (CKB)\n```\n\n#### 4. Type yes or y and input the password to unlock the account.\n\n```\n(1/3) Sending tx 56353f036c04b153eaa6ef31a8637fb673b255fa62becf1c253b00aace643ae1\n(2/3) Sending tx f15d81696d1e2fd9e1e128ca95fb8ee3263e04961323ca1e74b8809cb4529828\n(3/3) Sending tx 2ebd890517f1a54f5f1a0084bd2111203266d6c321b190232f3ceaa322ef7fd5\nDeployment complete\n```\n\nNow the cheque script has been deployed, you can refer to this script by using `tx_hash: 2ebd890517f1a54f5f1a0084bd2111203266d6c321b190232f3ceaa322ef7fd5 index: 0` as `out_point`(your tx_hash should be another value).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanyytop%2Fckb-cheque-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduanyytop%2Fckb-cheque-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanyytop%2Fckb-cheque-script/lists"}