{"id":13456751,"url":"https://github.com/Bonfida/name-tokenizer","last_synced_at":"2025-03-24T11:31:13.640Z","repository":{"id":42380677,"uuid":"465294160","full_name":"Bonfida/name-tokenizer","owner":"Bonfida","description":"Tokenize a domain name into an NFT","archived":false,"fork":false,"pushed_at":"2024-02-26T04:23:24.000Z","size":495,"stargazers_count":28,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-18T03:46:05.664Z","etag":null,"topics":["metaplex","rust","solana","solana-program","typescript"],"latest_commit_sha":null,"homepage":"https://naming.bonfida.org","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}},"created_at":"2022-03-02T12:21:16.000Z","updated_at":"2024-04-25T02:44:43.536Z","dependencies_parsed_at":"2023-10-13T07:25:36.294Z","dependency_job_id":"4049fc18-0c92-4517-a525-a2a8875a48eb","html_url":"https://github.com/Bonfida/name-tokenizer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fname-tokenizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fname-tokenizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fname-tokenizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fname-tokenizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bonfida","download_url":"https://codeload.github.com/Bonfida/name-tokenizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245260825,"owners_count":20586477,"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":["metaplex","rust","solana","solana-program","typescript"],"created_at":"2024-07-31T08:01:27.098Z","updated_at":"2025-03-24T11:31:13.291Z","avatar_url":"https://github.com/Bonfida.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003eName tokenizer\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\nTokenize domain name into Metaplex NFTs\n\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" /\u003e\n\u003cimg src=\"https://img.shields.io/badge/Rust-000000?style=for-the-badge\u0026logo=rust\u0026logoColor=white\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\u003ch2 align=\"center\"\u003eTable of contents\u003c/h2\u003e\n\u003cbr /\u003e\n\n1. [Program ID](#program-id)\n2. [Introduction](#introduction)\n3. [Security](#security)\n4. [Reproducible build](#build)\n5. [Collection](#collection)\n6. [Mint](#mint)\n7. [NFT](#nft)\n8. [Tests](#tests)\n   - Rust\n   - JS\n\n\u003cbr /\u003e\n\u003ca name=\"program-id\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eProgram ID\u003c/h2\u003e\n\u003cbr /\u003e\n\nMainnet program ID `nftD3vbNkNqfj2Sd3HZwbpw4BxxKWr4AjGb9X38JeZk`\n\n\u003cbr /\u003e\n\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eIntroduction\u003c/h2\u003e\n\u003cbr /\u003e\n\nThis program allows people to tokenize their domain name in NFTs that follow the [Metaplex standard](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/token-metadata) with a creation/redemption mechanism.\n\n\u003cbr /\u003e\n\u003ca name=\"build\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eReproducible build\u003c/h2\u003e\n\u003cbr /\u003e\n\nA reproducible build script (`build.sh`) can be used to build the program using docker\n\n\u003cbr /\u003e\n\u003ca name=\"security\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eSecurity\u003c/h2\u003e\n\u003cbr /\u003e\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\n\u003cbr /\u003e\n\u003ca name=\"collection\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eCollection\u003c/h2\u003e\n\u003cbr /\u003e\n\nNFTs are all part of a verified collection `E5ZnBpH9DYcxRkumKdS4ayJ3Ftb6o3E8wSbXw4N92GWg`.\n\n\u003cbr /\u003e\n\u003ca name=\"mint\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eMint\u003c/h2\u003e\n\u003cbr /\u003e\n\nNFT mints are PDAs derived from the domain name key they represent. The derivation is made as follow:\n\n```rust\npub const MINT_PREFIX: \u0026[u8; 14] = b\"tokenized_name\";\n\n// ...\n\nlet (mint, mint_nonce) = Pubkey::find_program_address(\n    \u0026[MINT_PREFIX, \u0026accounts.name_account.key.to_bytes()],\n    program_id,\n);\n```\n\n\u003cbr /\u003e\n\u003ca name=\"nft\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eNFT\u003c/h2\u003e\n\u003cbr /\u003e\n\nWhen a domain name is tokenized its ownership is transfered to a PDA that will be holding the domain while it's tokenized. In exchange, the program mints an NFT for the user. When redeeming the domain is transfered back to the NFT holder and the NFT burned.\n\nDuring the tokenization process an `NftRecord` is created with the following state:\n\n```rust\npub struct NftRecord {\n    /// Tag\n    pub tag: Tag,\n\n    /// Nonce\n    pub nonce: u8,\n\n    /// Name account of the record\n    pub name_account: Pubkey,\n\n    /// Record owner\n    pub owner: Pubkey,\n\n    /// NFT mint\n    pub nft_mint: Pubkey,\n}\n```\n\nIf funds are sent by mistake to the `NftRecord` instead of the NFT holder while the domain is tokenized the owner has the possibility to withdraw them. The \"correct owner\" is determined as follow:\n\n- If the `NftRecord` is active i.e domain is tokenized: The correct owner is the NFT holder\n- If `NftRecord` is inactive i.e the NFT has been redeemed: The correct owner is the last person who redeemed (`owner` field in the `NftRecord`)\n\n\u003cbr /\u003e\n\u003ca name=\"tests\"\u003e\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eTests\u003c/h2\u003e\n\u003cbr /\u003e\n\n### Rust\n\nFunctional Rust tests can be run with\n\n```\ncargo test-bpf --features devnet\n```\n\n### JS\n\nEnd to end tests can be run with\n\n```\nyarn jest\n```\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBonfida%2Fname-tokenizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBonfida%2Fname-tokenizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBonfida%2Fname-tokenizer/lists"}