{"id":31822920,"url":"https://github.com/devfans/zrc-20","last_synced_at":"2026-02-16T08:04:13.744Z","repository":{"id":163886730,"uuid":"639327212","full_name":"devfans/zrc-20","owner":"devfans","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-04T03:55:24.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-04T10:07:10.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/devfans.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}},"created_at":"2023-05-11T08:42:27.000Z","updated_at":"2024-01-04T10:07:10.862Z","dependencies_parsed_at":"2024-01-03T09:54:09.580Z","dependency_job_id":"2b60b6c0-8340-43fb-b00c-fbfcab81a3aa","html_url":"https://github.com/devfans/zrc-20","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/devfans/zrc-20","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfans%2Fzrc-20","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfans%2Fzrc-20/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfans%2Fzrc-20/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfans%2Fzrc-20/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devfans","download_url":"https://codeload.github.com/devfans/zrc-20/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfans%2Fzrc-20/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007496,"owners_count":26084313,"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-10-11T02:00:06.511Z","response_time":55,"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":[],"created_at":"2025-10-11T14:20:27.153Z","updated_at":"2025-10-11T14:20:33.777Z","avatar_url":"https://github.com/devfans.png","language":null,"readme":"# zrc-20\n\n## zrc-20\n\nThis standard is fully based on domo-2's [brc-20 standard](https://domo-2.gitbook.io/brc-20-experiment/), with an extension of one extra op code(**delegate)** to introduce brc-20 tokens to bitcoin L2 chains. The purpose is to extend the usability of brc-20 token, so users could port brc-20 tokens into the layer 2 tokens and operate brc-20 tokens same way as erc-20 tokens on L2 chains.​\n\n\n\n\u003cfigure\u003e\u003cimg src=\".gitbook/assets/Screenshot 2024-01-03 at 16.37.52.png\" alt=\"\"\u003e\u003cfigcaption\u003e\u003c/figcaption\u003e\u003c/figure\u003e\n\n\n\nChanges:\u0026#x20;\n\n* The deploy operation of the zrc-20 tokens on Bitcoin will be interpreted into erc-20 contract deployment on L2, so each zrc-20 token will have a mirror erc-20 token on L2.\u0026#x20;\n\n```json\n{ \n  \"p\": \"zrc-20\",\n  \"op\": \"deploy\",\n  \"tick\": \"ordi\",\n  \"max\": \"21000000\",\n  \"lim\": \"1000\",\n  \"difficulty\": \"5\"\n}\n```\n\n* Bitcoin account (address A) will have a mapped account (address a) so that: \u003cmark style=\"color:blue;\"\u003e`a = keccak(A)[12:]`\u003c/mark\u003e, mapped account does not have the permission to operate the token since no one will have the private key of p.\u0026#x20;\n* A L2 chain will serve as the ledge of zrc-20 tokens. That means all zrc-20 token operations on the Bitcoin chain will be tracked and interpreted into L2 token contract interactions, so the balance of zrc-20 tokens can be easily checked by calling the mirror erc-20 contract. There’ll be a dedicated module(the indexer module) in Layer 2 node to index the zrc-20 inscriptions, this module works just like brc-20 indexer but with the extended feature supported.\u0026#x20;\n* With the op code delegate, a zrc-20 user A could delegate some of the balance to L2 account b, so that the private key holder of account b will be capable of operating these tokens while the balance will be deducted from user A's account. The delegate operation doing the exact operation of transferring tokens to a L2 account. After this operation, the L2 account user could operate the token the same way as erc-20 tokens, no matter if it's a transfer, swap or lock. The inscription should be sent to the sender again as a second step. When the sequencer of the L2 network produce L2 blocks, it will execute these zrc-20 operations on the erc-20 mirror contracts.\n\n\u003cpre class=\"language-python\"\u003e\u003ccode class=\"lang-python\"\u003e\u003cstrong\u003e\n\u003c/strong\u003e\u003cstrong\u003edef derive_zrc20_delegations(delegations: List[Delegattion]) -\u003e List[DelegationSystemTxs]:\n\u003c/strong\u003e\u003cstrong\u003e    return [derive_delegation_transaction(delegation) for delegation in delegations if is_delegation_valid(delegation)]\n\u003c/strong\u003e\u003cstrong\u003e            \n\u003c/strong\u003e\u003cstrong\u003edef produce_l2_block(parent: L2Block, current_l1_block: L1Block) -\u003e L2Block:\n\u003c/strong\u003e\u003cstrong\u003e    l2_block_candidate = new_l2_block_from_parent(parent)\n\u003c/strong\u003e\u003cstrong\u003e    if parent.l1_block.number != current_l1_block.number:\n\u003c/strong\u003e\u003cstrong\u003e        delegations = fetch_l1_zrc20_delegations(parent.l1_block.number, current_l1_block.number)\n\u003c/strong\u003e\u003cstrong\u003e        delegations_transactions = derive_zrc20_delegations(delegations)\n\u003c/strong\u003e\u003cstrong\u003e        l2_block_candidate.system_txs = [*l2_block_candidate.system_txs, *delegations_transactions]\n\u003c/strong\u003e\u003cstrong\u003e    return l2_block_candidate\n\u003c/strong\u003e\u003cstrong\u003e    \n\u003c/strong\u003e\u003c/code\u003e\u003c/pre\u003e\n\n```json\n{ \n  \"p\": \"zrc-20\",\n  \"op\": \"delegate\",\n  \"tick\": \"ordi\",\n  \"amt\": \"100\",\n  \"chain\": \"l2-chain-a\",\n  \"to\": \"0x3Ea1756E8Ce21a41E15eC3F026A0eA379Cc3e1A5\"\n}\n```\n\n* If L2 account b transfers some of the balance to a L2 mapped account (address a), that means an operation of un-delegate. After this operation, the transferred balance will be only spendable by the private key holder of the original L1 account A(such that \u003cmark style=\"color:blue;\"\u003e`a = keccak(A)[12:]`\u003c/mark\u003e).\u0026#x20;\n* Each time a newer state of the L2 network is submitted to the Bitcoin and verified in a way(ZKP etc), the afterward transfers which follow un-delegations can be assumed valid.\n\n\n\n​With this extension proposal, brc-20 token could be ported to an erc-20 token on Bitcoin L2 chains. Users will need no more to worry about the Bitcoin network congestions or inscriptions since the token will be treated same as erc-20 token on layer 2s. This greatly increases the usability of brc-20 tokens.​ The next page is the original brc20 standard.\n\n\n\nThe original brc-20 standard: [https://domo-2.gitbook.io/brc-20-experiment/](https://domo-2.gitbook.io/brc-20-experiment/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfans%2Fzrc-20","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevfans%2Fzrc-20","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfans%2Fzrc-20/lists"}