{"id":19190168,"url":"https://github.com/xrplf/ctid","last_synced_at":"2025-05-08T04:46:51.235Z","repository":{"id":66231284,"uuid":"600379727","full_name":"XRPLF/CTID","owner":"XRPLF","description":"Improved Concise Transaction Identifier (CTIM) code samples and test cases","archived":false,"fork":false,"pushed_at":"2023-02-14T08:31:42.000Z","size":33,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-08T04:46:38.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XRPLF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-02-11T10:04:14.000Z","updated_at":"2023-12-21T09:49:14.000Z","dependencies_parsed_at":"2023-05-03T09:31:57.800Z","dependency_job_id":null,"html_url":"https://github.com/XRPLF/CTID","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/XRPLF%2FCTID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2FCTID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2FCTID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2FCTID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XRPLF","download_url":"https://codeload.github.com/XRPLF/CTID/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002843,"owners_count":21838637,"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":[],"created_at":"2024-11-09T11:33:08.697Z","updated_at":"2025-05-08T04:46:51.227Z","avatar_url":"https://github.com/XRPLF.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quickstart \n## Improved Concise Transaction Identifier (CTID) \n\nCTIDs are composed of 16 hex nibbles, and begin with a `C`.\n\n```\nCXXXXXXXYYYYZZZZ\n```\n\nThe identifier is divided into three fields.\n\nChar Offset | Field | Size (bits) |Explanation\n-|-----|------|---------\n0 | C| 4 | Lead-in (ignore)\n1-7 | XXXXXXX | 28 |  Ledger Sequence\n8-11 | YYYY | 16 | Transaction index (offset) within that ledger\n12-16 | ZZZZ | 16 | Network ID.\n\nReference implementations are available for several languages. Click below to dive in.\n\nLanguage | Implementation\n-|-\nJavascript | [ctid.js](https://github.com/XRPLF/ctid/blob/main/ctid.js)\nTypescript | [ctid.ts](https://github.com/XRPLF/ctid/blob/main/ctid.ts)\nC++ | [ctid.cpp](https://github.com/XRPLF/ctid/blob/main/ctid.cpp)\nPython 3| [ctid.py](https://github.com/XRPLF/ctid/blob/main/ctid.py)\nPHP 5|[ctid.php](https://github.com/XRPLF/ctid/blob/main/ctid.php)\n\n\n### Function prototypes (pseudocode)\nIn this repo there are several reference implementations available for various languages but they all use the same function model.\n```js\nfunction encodeCTID (\n  ledger_seq : number,\n  txn_index  : number,\n  network_id : number) -\u003e string;\n```\n```js\nfunction decodeCTID (ctid : string or number) -\u003e { \n  ledger_seq : number,\n  txn_index  : number,\n  network_id : number };\n```\n\n### Mainnet example\n[This transaction](https://livenet.xrpl.org/transactions/D42BE7DF63B4C12E5B56B4EFAD8CBB096171399D93353A8A61F61066160DFE5E/raw) encodes in the following way:\n```js\nencodeCTID(\n  77727448, // ledger sequence number the txn appeared in\n  54,       // `TransactionIndex` as per metadata\n  0)        // Network ID of mainnet is 0\n'C4A206D800360000'\n```\n\n### Hooks testnet v3 example\n[This transaction](https://hooks-testnet-v3-explorer.xrpl-labs.com/tx/C4E284010276F8457C4BF96D0C534B7383087680C159F9B8C18D5EE876F7EFE7) encodes in the following way:\n```js\nencodeCTID(\n  428986, // ledger sequence number the txn appeared in\n  0,      // `TransactionIndex` as per metadata\n  21338)  // Network ID of hooks v3 is 21338\n'C0068BBA0000535A'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplf%2Fctid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxrplf%2Fctid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplf%2Fctid/lists"}