{"id":20737588,"url":"https://github.com/patronum-labs/nick-method","last_synced_at":"2025-10-07T03:41:29.596Z","repository":{"id":247784179,"uuid":"826520822","full_name":"Patronum-Labs/nick-method","owner":"Patronum-Labs","description":"NPM package that facilitates generating transactions adhering to Nick-Method.","archived":false,"fork":false,"pushed_at":"2024-07-15T23:38:19.000Z","size":95,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T08:39:01.230Z","etag":null,"topics":["deterministic-deployment","legacy-transactions","nick-factory","nick-method","pre-eip155-transactions","unprotected-transactions"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@patronumlabs/nick-method","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Patronum-Labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://etherscan.io/address/0x5D551AbEAD9b93ebd0D092722517136FF278c3D0"}},"created_at":"2024-07-09T21:40:03.000Z","updated_at":"2025-03-01T18:20:37.000Z","dependencies_parsed_at":"2024-07-16T03:17:00.414Z","dependency_job_id":null,"html_url":"https://github.com/Patronum-Labs/nick-method","commit_stats":null,"previous_names":["patronum-labs/nick-method"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Patronum-Labs/nick-method","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fnick-method","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fnick-method/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fnick-method/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fnick-method/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Patronum-Labs","download_url":"https://codeload.github.com/Patronum-Labs/nick-method/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fnick-method/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717431,"owners_count":26033539,"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-07T02:00:06.786Z","response_time":59,"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":["deterministic-deployment","legacy-transactions","nick-factory","nick-method","pre-eip155-transactions","unprotected-transactions"],"created_at":"2024-11-17T06:14:56.869Z","updated_at":"2025-10-07T03:41:29.580Z","avatar_url":"https://github.com/Patronum-Labs.png","language":"TypeScript","funding_links":["https://etherscan.io/address/0x5D551AbEAD9b93ebd0D092722517136FF278c3D0"],"categories":[],"sub_categories":[],"readme":"![Nick MethodSmaller](https://github.com/Patronum-Labs/nick-method/assets/86341666/8b392eea-74aa-4c73-95fe-fb355bc04d57)\n\n# @patronumlabs/nick-method\n\n[![Test nick-method](https://github.com/Patronum-Labs/nick-method/actions/workflows/main.yml/badge.svg)](https://github.com/Patronum-Labs/nick-method/actions/workflows/main.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)\n[![npm package](https://img.shields.io/npm/v/@patronumlabs/nick-method.svg)](https://www.npmjs.com/package/@patronumlabs/nick-method)\n\nThis package provides utilities for generating transactions according to the Nick Method, supporting both normal execution transactions and deployment transactions.\n\n## Rationale\n\nThe Nick Method allows for creating contracts on different chains at the same address without centralized control of a private key, and minimizes trust in execution. These transactions are useful for:\n\n-   Deploying contracts to the same address across multiple chains\n-   Executing transactions without direct control of private keys\n-   Minimizing trust requirements in transaction execution\n\nFor a full explanation, please refer to the article: [Nick Method - Ethereum Keyless execution](https://yamenmerhi.medium.com/nicks-method-ethereum-keyless-execution-168a6659479c)\n\n## Installation\n\n```bash\nnpm install @patronumlabs/nick-method\n```\n\n## Usage\n\nHere's an example of how to use the package to generate and broadcast transactions:\n\n```javascript\nimport { ethers } from 'ethers'; // ethers@v6\nimport { genRawDeployment, genRawTransaction } from '@patronumlabs/nick-method';\n\n// Example provider\nconst provider = new ethers.JsonRpcProvider('https://mainnet.infura.io/v3/YOUR-PROJECT-ID');\n\n// Step 1: Generate a raw deployment transaction\n\n// Generate a raw deployment transaction\nconst deploymentConfig = {\n    gasLimit: 1000000,\n    gasPrice: 100000000000,\n    bytecode: '0x60806040',\n    value: 0,\n};\n\nconst deploymentResult = genRawDeployment(deploymentConfig);\nconsole.log('Deployment Result:', deploymentResult);\n\n// Step 2: Fund the deployment transaction\n\n// // ------------------------------------------------------------\n// // Funding should be sent to deploymentResult.deployerAddress\n// // The funds to be sent equal to deploymentResult.upfrontCost\n// // The contract will be created at deploymentResult.contractAddress\n// // ------------------------------------------------------------\n\n// Step 3: Broadcast the deployment transaction\n\n// Broadcast the deployment transaction\nprovider.broadcastTransaction(deploymentResult.rawTx).then((tx) =\u003e {\n    console.log('Deployment Transaction Hash:', tx.hash);\n});\n\n/* ----------------------------------------------------------------- */\n/* ----------------------------------------------------------------- */\n/* ----------------------------------------------------------------- */\n\n// Step 1: Generate a raw execution transaction\n\n// Generate a raw execution transaction\nconst transactionConfig = {\n    gasLimit: 21000,\n    gasPrice: 20000000000,\n    to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',\n    data: '0x',\n    value: ethers.parseEther('0.1'),\n};\n\nconst transactionResult = genRawTransaction(transactionConfig);\nconsole.log('Transaction Result:', transactionResult);\n\n// Step 2: Fund the execution transaction\n\n// ------------------------------------------------------------\n// Funding should be sent to transactionResult.senderAddress\n// The funds to be sent equal to transactionResult.upfrontCost\n// ------------------------------------------------------------\n\n// Step 3: Broadcast the execution transaction\n\n// Broadcast the execution transaction\nprovider.broadcastTransaction(transactionResult.rawTx).then((tx) =\u003e {\n    console.log('Execution Transaction Hash:', tx.hash);\n});\n```\n\nThis example demonstrates how to generate both deployment and execution transactions using the Nick Method, and how to broadcast them to the network using ethers.js.\n\n## API Reference\n\n### genRawDeployment(config: DeploymentConfig): DeploymentResult\n\nGenerates a raw deployment transaction.\n\n### genRawTransaction(config: TransactionConfig): TransactionResult\n\nGenerates a raw execution transaction.\n\n### recoverRawTransaction(rawTransaction: string): RecoveredTransactionResult\n\nRecovers transaction details from a raw transaction string.\n\n- `rawTransaction`: The raw transaction data as a hexadecimal string.\n- Returns: An object containing the recovered transaction details.\n\nFor detailed type definitions of `DeploymentConfig`, `DeploymentResult`, `TransactionConfig`, `TransactionResult`, and `RecoveredTransactionResult`, please refer to the source code or TypeScript definitions.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatronum-labs%2Fnick-method","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatronum-labs%2Fnick-method","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatronum-labs%2Fnick-method/lists"}