{"id":18300948,"url":"https://github.com/bonfida/sns-categories","last_synced_at":"2025-04-05T14:30:47.836Z","repository":{"id":168248312,"uuid":"629400820","full_name":"Bonfida/sns-categories","owner":"Bonfida","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-19T11:35:00.000Z","size":3289,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T12:26:42.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Bonfida.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-04-18T08:34:31.000Z","updated_at":"2025-03-19T11:35:04.000Z","dependencies_parsed_at":"2023-11-12T08:27:32.052Z","dependency_job_id":"dc2a0437-a32b-4761-8eab-86bb78ef30e8","html_url":"https://github.com/Bonfida/sns-categories","commit_stats":null,"previous_names":["bonfida/sns-categories"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fsns-categories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fsns-categories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fsns-categories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fsns-categories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bonfida","download_url":"https://codeload.github.com/Bonfida/sns-categories/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247352254,"owners_count":20925236,"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-05T15:13:57.120Z","updated_at":"2025-04-05T14:30:46.823Z","avatar_url":"https://github.com/Bonfida.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSNS Categories\u003c/h1\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"250\" src=\"https://i.imgur.com/nn7LMNV.png\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://twitter.com/bonfida\"\u003e\n\u003cimg src=\"https://img.shields.io/twitter/url?label=Bonfida\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fbonfida\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e\nCreate, manage and interact with SNS Optics categories on-chain\n\u003c/strong\u003e\n\u003c/p\u003e\n\n![diagram](./assets/diagram.png)\n\n\u003cbr /\u003e\n\u003ch2 align=\"center\"\u003eIntroduction\u003c/h2\u003e\n\u003cbr /\u003e\nSNS Categories is a Solana program for managing SNS Optics categories. It provides functionalities to create a new category, add members to an existing category, and remove members from a category. It's currently in beta and open for contributions from the community.\n\n\u003cbr /\u003e\n\u003ch2 align=\"center\"\u003eFeatures\u003c/h2\u003e\n\u003cbr /\u003e\n\n- **Create category:** Enables the creation of a new category on Solana Name Service.\n- **Add member:** Allows the addition of a new member to an existing category.\n- **Remove member:** Allows the removal of a member from an existing category.\n\n### How can I verify that a domain belongs to a category?\n\nBelonging to a category is equivalent to the category member being a child (or subdomain) of the category metadata. In order to check if a .sol domain is part of a category, you need to follow these steps:\n\n1. Derive the category public key: You can derive the category public key by using the category name and the appropriate hashing method provided by the program\n\n2. Derive the category member public key associated with the domain: You can derive the category member public key by using the domain name and the category public key obtained in the previous step\n\n3. Check the on-chain data: Query the on-chain data for the derived category member public key. If the account is present, it indicates that the domain is part of the category.\n\n### How can I get all the members of a category?\n\nAll members of a category can be retrieved via a `getProgramAccount` RPC request and the following filters:\n\n```js\n  const filters: MemcmpFilter[] = [\n    {\n      memcmp: {\n        offset: 0,\n        bytes: category.toBase58(),\n      },\n    },\n    {\n      memcmp: {\n        offset: NameRegistryState.HEADER_LEN,\n        bytes: ((Tag.CategoryMember as number) + 1).toString(),\n      },\n    },\n  ];\n```\n\n### How can I get all the categories?\n\nAll categories can be retrieved via a `getProgramAccount` RPC request and the following filters:\n\n```js\nconst filters: MemcmpFilter[] = [\n  {\n    memcmp: {\n      offset: 0,\n      bytes: CATEGORY_TLD.toBase58(),\n    },\n  },\n  {\n    memcmp: {\n      offset: NameRegistryState.HEADER_LEN,\n      bytes: (Tag.CategoryMetadata + 1).toString(),\n    },\n  },\n];\n```\n\n## Reproducible build\n\nA reproducible build script (`build.sh`) can be used to build the program using docker\n\n## Security\n\nFor security disclosures or to report a bug, please visit [ImmuneFi](https://immunefi.com/bounty/bonfida/) for more information on our bug bounty program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonfida%2Fsns-categories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonfida%2Fsns-categories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonfida%2Fsns-categories/lists"}