{"id":50440620,"url":"https://github.com/convex-dev/cad3","last_synced_at":"2026-05-31T19:01:08.265Z","repository":{"id":359764343,"uuid":"1247249244","full_name":"Convex-Dev/cad3","owner":"Convex-Dev","description":"Convex CAD3 encoded data structures, in Rust","archived":false,"fork":false,"pushed_at":"2026-05-23T10:17:00.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-23T11:36:56.643Z","etag":null,"topics":["cad3","convex","encoding","lattice","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Convex-Dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T04:28:10.000Z","updated_at":"2026-05-23T10:17:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Convex-Dev/cad3","commit_stats":null,"previous_names":["convex-dev/cad3"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Convex-Dev/cad3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fcad3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fcad3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fcad3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fcad3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Convex-Dev","download_url":"https://codeload.github.com/Convex-Dev/cad3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convex-Dev%2Fcad3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33744447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["cad3","convex","encoding","lattice","rust"],"created_at":"2026-05-31T19:01:07.329Z","updated_at":"2026-05-31T19:01:08.254Z","avatar_url":"https://github.com/Convex-Dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cad3\n\n[![CI](https://github.com/Convex-Dev/cad3/actions/workflows/ci.yml/badge.svg)](https://github.com/Convex-Dev/cad3/actions/workflows/ci.yml)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n\nRust implementation of [Convex CAD3](https://docs.convex.world/cad/003_encoding/) — the\ncanonical wire and storage encoding for Convex lattice data values.\n\n\u003e **Status:** early. The small primitive variants are landed; collections,\n\u003e blobs/strings, and the rest are next. The Java reference implementation\n\u003e lives at [`Convex-Dev/convex`](https://github.com/Convex-Dev/convex) under\n\u003e `convex-core/src/main/java/convex/core/data/`. Architectural design lives\n\u003e in [`docs/CELL_DESIGN.md`](docs/CELL_DESIGN.md).\n\n## What's CAD3?\n\nCAD3 is a compact, self-describing, canonical binary encoding for immutable data values.\nEvery value has exactly one valid byte representation, and the SHA3-256 hash of that\nencoding is the value's stable, decentralised identifier (the \"value ID\"). Larger values\nform Merkle DAGs via embedded child encodings or external value-ID references, enabling\nstructural sharing, partial transmission, and arbitrary-size data structures inside\nfixed-size buffers.\n\nSee the [CAD3 specification](https://docs.convex.world/cad/003_encoding/) for full details.\n\n## Implemented\n\n| Tag(s)        | Type        | Notes                                                       |\n| ------------- | ----------- | ----------------------------------------------------------- |\n| `0x00`        | `nil`       | single-byte encoding                                        |\n| `0x10`–`0x18` | Long        | signed `i64`, minimal-length two's complement               |\n| `0x1D`        | Double      | IEEE 754, canonical NaN                                     |\n| `0x30`        | String      | UTF-8 (not enforced), leaf only — ≤ 4096 bytes              |\n| `0x31`        | Blob        | arbitrary bytes, leaf only — ≤ 4096 bytes                   |\n| `0x3C`–`0x3E` | Char        | Unicode scalar, minimal-length                              |\n| `0xB0`–`0xBF` | Byte flags  | `0xB0` = CVM `false`, `0xB1` = CVM `true`                   |\n| `0xEA`        | Address     | account index, VLQ payload                                  |\n\nRoadmap (in rough order): BigInt, Symbol, Keyword, Ref + Vector (forces\ntree form for large Blob/String), List, Map, Set, Index, signed data,\nrecords.\n\n## Usage\n\n```toml\n[dependencies]\ncad3 = \"0.0.1\"\n```\n\n```rust\nuse cad3::Cell;\nuse bytes::Bytes;\n\n// Encoding — one canonical byte sequence per value\nassert_eq!(Cell::Nil.encoding(),                     vec![0x00]);\nassert_eq!(Cell::FALSE.encoding(),                   vec![0xB0]);\nassert_eq!(Cell::Long(19).encoding(),                vec![0x11, 0x13]);\nassert_eq!(Cell::Char('A').encoding(),               vec![0x3C, 0x41]);\nassert_eq!(Cell::Address(128).encoding(),            vec![0xEA, 0x81, 0x00]);\nassert_eq!(Cell::string(Bytes::from_static(b\"Hi\")).encoding(),\n                                                     vec![0x30, 0x02, b'H', b'i']);\nassert_eq!(Cell::blob(Bytes::from_static(\u0026[1,2,3])).encoding(),\n                                                     vec![0x31, 0x03, 1, 2, 3]);\n\n// Round trip\nlet cell = Cell::decode(\u0026Cell::Long(42).encoding()).unwrap();\nassert_eq!(cell, Cell::Long(42));\n\n// Cheap sharing — cloning a heavy cell is one atomic refcount bump\nlet blob = Cell::blob(Bytes::from(vec![0xAB; 4096]));\nlet shared = blob.clone();   // no copy of the 4096 bytes; Arc bumped\n\n// Value ID = SHA3-256 of the canonical encoding (cached on heavy cells)\nlet id = Cell::Long(42).value_id();\nprintln!(\"value id = {id}\");\n```\n\n## Development\n\nRequires Rust 1.75 or later.\n\n```bash\ncargo fmt --all\ncargo clippy --all-targets -- -D warnings\ncargo test\n```\n\n## License\n\nLicensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvex-dev%2Fcad3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconvex-dev%2Fcad3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvex-dev%2Fcad3/lists"}