{"id":20855583,"url":"https://github.com/bitman310/fractal-brc20-launchpad","last_synced_at":"2025-04-15T23:53:26.528Z","repository":{"id":263243729,"uuid":"889779693","full_name":"bitman310/fractal-brc20-launchpad","owner":"bitman310","description":"The BRC-20 Token Launchpad on the Fractal Bitcoin Network is tailored to showcase newly deployed tokens and their minting progress. It enables users to independently deploy, mint, and transfer these tokens.","archived":false,"fork":false,"pushed_at":"2025-03-19T09:41:52.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T03:03:59.044Z","etag":null,"topics":["bitcoin","brc20","launchpad","mint","token","transfer"],"latest_commit_sha":null,"homepage":"","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/bitman310.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":"2024-11-17T07:57:54.000Z","updated_at":"2025-03-19T09:41:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f58695a5-088e-4ff4-9ac6-5799aaa8be70","html_url":"https://github.com/bitman310/fractal-brc20-launchpad","commit_stats":null,"previous_names":["bitman310/fractal-brc20-launchpad"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman310%2Ffractal-brc20-launchpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman310%2Ffractal-brc20-launchpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman310%2Ffractal-brc20-launchpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman310%2Ffractal-brc20-launchpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitman310","download_url":"https://codeload.github.com/bitman310/fractal-brc20-launchpad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["bitcoin","brc20","launchpad","mint","token","transfer"],"created_at":"2024-11-18T04:19:31.106Z","updated_at":"2025-04-15T23:53:26.515Z","avatar_url":"https://github.com/bitman310.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoin fractal-brc20-launchpad\nThe BRC-20 Token Launchpad on the Fractal Bitcoin Network is tailored to showcase newly deployed tokens and their minting progress. It enables users to independently deploy, mint, and transfer these tokens.\n\n## Features\n\n- **Token Deployment:** Seamlessly deploy new BRC20 tokens on the network.\n- **Minting Progress Tracking:** Monitor the status of token minting in real-time.\n- **Token Transfers:** Safely transfer BRC20 tokens to other addresses.\n- **Scalability:** Engineered with Node.js and TypeScript to support efficient scaling.\n- **Comprehensive API:** Offers a robust API for managing and interacting with BRC20 tokens.\n\n## Github Reference Repository\n```bash\ngit clone https://github.com/bitman310/fractal-brc20-launchpad.git\ncd fractal-brc20-launchpad\n```\n\n## Project Structure\n\n```plaintext\nfractal-brc20-launchpad/\n│\n├── src/\n│   ├── controllers/\n│   ├── models/\n│   ├── routes/\n│   ├── services/\n│   └── utils/\n│\n├── tests/\n├── package.json\n└── tsconfig.json\n```\n\n### API Endpoints\n\n- **Deploy Token**: `POST /api/tokens/deploy`\n- **Mint Token**: `POST /api/tokens/mint`\n- **Transfer Token**: `POST /api/tokens/transfer`\n\n### BRC20 Token Codebase Part\n\n- **BRC20 Send Function**\n\n```typescript\n\n/**\n * reveal a brc20 txid\n *\n * @param {Signer} keypair - The number of keypair\n * @param {string} p - The mark of inscription, like ord\n * @param {string} data - The data inside an brc20\n * @param {string} txid - The txid used to reveal\n * @param {string} network - The network used for taproot address\n * @returns {{ p2tr, redeem }} - return an taproot address and its reedem script\n */\nexport async function brc20_send(keypair: Signer, p: string, data: string, txid: string, network: string) {\n    const ins_script = [\n        toXOnly(keypair.publicKey),\n        opcodes.OP_CHECKSIG,\n        opcodes.OP_0,\n        opcodes.OP_IF,\n        // in normal situation, p = 'ord'\n        Buffer.from(p),\n        1,\n        Buffer.from('text/plain;charset=utf-8'),\n        opcodes.OP_0,\n        Buffer.from(data),\n        opcodes.OP_ENDIF\n    ];\n    let { p2tr, redeem } = taproot_address_from_asm(script.compile(ins_script), keypair, network)\n    let addr = p2tr.address ?? \"\";\n\n    const utxos = await getUTXOfromTx(txid, addr)\n    console.log(`Using UTXO ${utxos.txid}:${utxos.vout}`);\n\n    const psbt = new bitcoin.Psbt({ network: choose_network(network) });\n\n    psbt.addInput({\n        hash: utxos.txid,\n        index: utxos.vout,\n        witnessUtxo: { value: utxos.value, script: p2tr.output! },\n    });\n\n    psbt.updateInput(0, {\n        tapLeafScript: [\n            {\n                leafVersion: redeem.redeemVersion,\n                script: redeem.output,\n                controlBlock: p2tr.witness![p2tr.witness!.length - 1],\n            },\n        ],\n    });\n\n    psbt.addOutput({ value: utxos.value - 150, address: p2tr.address! });\n    psbt.signInput(0, keypair);\n\n    // Finalize and send out tx\n    txBroadcastVeify(psbt, addr)\n}\n\n\n```\n\n- **BRC20 Token Mint Function**\n\n```typescript\n\n// using rpc to send/mint/deploy brc20 transaction\nexport async function brc20_mint_rpc(receiveAddress: string, feeRate: number, outputValue: number, devAddress: string, devFee: number, brc20Ticker: string, brc20Amount: string, count: number) {\n    return new Promise\u003cstring\u003e((resolve, reject) =\u003e {\n        const data = {\n            headers: { \"Authorization\": `Bearer ${API_KEY}` },\n            jsonrpc: \"2.0\",\n            body: {\n                receiveAddress,\n                feeRate,\n                outputValue,\n                devAddress,\n                devFee,\n                brc20Ticker,\n                brc20Amount,\n                count\n            }\n        }\n        let _URL = URL + \"inscribe/order/create/brc20-mint\"\n        try {\n            axios.post(_URL, data).then(\n                firstResponse =\u003e {\n                    console.log(firstResponse.data)\n                    resolve(JSON.parse(JSON.stringify(firstResponse.data)).result)\n                });\n        } catch (error) {\n            reject(error);\n        }\n    })\n}\n\n\n```\n\n- **BRC20 Token Deploy Function**\n\n```typescript\n\nexport async function brc20_deploy_rpc(receiveAddress: string, feeRate: number, outputValue: number, devAddress: string, devFee: number, brc20Ticker: string, brc20Max: string, brc20Limit: string) {\n    return new Promise\u003cstring\u003e((resolve, reject) =\u003e {\n        const data = {\n            headers: { \"Authorization\": `Bearer ${API_KEY}` },\n            jsonrpc: \"2.0\",\n            body: {\n                receiveAddress,\n                feeRate,\n                outputValue,\n                devAddress,\n                devFee,\n                brc20Ticker,\n                brc20Max,\n                brc20Limit\n            }\n        }\n        let _URL = URL + \"inscribe/order/create/brc20-deploy\"\n        try {\n            axios.post(_URL, data).then(\n                firstResponse =\u003e {\n                    console.log(firstResponse.data)\n                    resolve(JSON.parse(JSON.stringify(firstResponse.data)).result)\n                });\n        } catch (error) {\n            reject(error);\n        }\n    })\n}\n\n```\n\n- **BRC20 Token Transfer Function**\n\n```typescript\n\nexport async function brc20_transfer_rpc(receiveAddress: string, feeRate: number, outputValue: number, devAddress: string, devFee: number, brc20Ticker: string, brc20Amount: string) {\n    return new Promise\u003cstring\u003e((resolve, reject) =\u003e {\n        const data = {\n            headers: { \"Authorization\": `Bearer ${API_KEY}` },\n            jsonrpc: \"2.0\",\n            body: {\n                receiveAddress,\n                feeRate,\n                outputValue,\n                devAddress,\n                devFee,\n                brc20Ticker,\n                brc20Amount\n            }\n        }\n        let _URL = URL + \"inscribe/order/create/brc20-transfer\"\n        try {\n            axios.post(_URL, data).then(\n                firstResponse =\u003e {\n                    console.log(firstResponse.data)\n                    resolve(JSON.parse(JSON.stringify(firstResponse.data)).result)\n                });\n        } catch (error) {\n            reject(error);\n        }\n    })\n}\n\n```\n- **BRC20 Builder Constructor Function**\n\n```typescript\n\n/**\n * Basic brc20 builder\n *\n * @param {Signer} keypair - The number of keypair\n * @param {string} data - The data inside an inscription\n * @param {string} network - The network used for taproot address\n * @returns {{ p2tr, redeem }} - return an taproot address and its reedem script\n */\nexport function brc_builder(keypair: Signer, data: string, network: string) {\n    const ins_script = [\n        toXOnly(keypair.publicKey),\n        opcodes.OP_CHECKSIG,\n        opcodes.OP_FALSE,\n        opcodes.OP_IF,\n        Buffer.from(\"ord\"),\n        1,\n        1,\n        Buffer.from(\"application/json\"),\n        opcodes.OP_0,\n        Buffer.from(data),\n        opcodes.OP_ENDIF\n    ];\n\n    let { p2tr, redeem } = taproot_address_from_asm(script.compile(ins_script), keypair, network)\n    return { p2tr, redeem }\n}\n\n\n```\n- **BRC20 Switch Deploy/Mint/Transfer Function**\n\n```typescript\n\n/**\n * The opcode of brc20\n *\n * @param {string} op - The command type, like deploy, mint, transfer\n * @param {string} tick - The name of brc20 token\n * @param {string} amt - The amount of brc20\n * @param {string} lim - The limit of brc20, only useful in deploy\n * @returns {string} - return the opcode of brc20 command in string format\n */\nexport function brc20_op(op: string, tick: string, amt: string, lim: string) {\n    switch (op) {\n        case \"deploy\":\n            return `{\"p\":\"brc-20\",\"op\":\"mint\",\"tick\":\"${tick}\",\"max\":\"${amt}\",\"lim\":\"${lim}\"}`\n        case \"mint\":\n            return `{\"p\":\"brc-20\",\"op\":\"mint\",\"tick\":\"${tick}\",\"amt\":\"${amt}\"}`\n        case \"transfer\":\n            return `{\"p\":\"brc-20\",\"op\":\"transfer\",\"tick\":\"${tick}\",\"amt\":\"${amt}\"}`\n    }\n}\n\n\n```\n\n### Configuration\n\n- Ensure that the `tsconfig.json` file is correctly set up with `\"strict\": true` for strict type-checking.\n- Define BitcoinClient with methods to interact with the Bitcoin blockchain via appropriate libraries and protocols for BRC20 token.\n\n### Testing\n\n- Set up automated tests within the `tests/` directory.\n- Use a framework such as Mocha or Jest to structure the tests.\n- Run tests using the command: \n\n```bash\nnpm test\n```\n\n## Contact Information\n\nFor technical support or development inquiries, please contact me through:\n\nLinkedIn: [@Ljubomir Igic](https://www.linkedin.com/in/ljubomir-igic-6a9615340)\n\nTelegram: [@Ljubomir Igic](https://t.me/@ljubomir_igic)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitman310%2Ffractal-brc20-launchpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitman310%2Ffractal-brc20-launchpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitman310%2Ffractal-brc20-launchpad/lists"}