{"id":25561965,"url":"https://github.com/0xvv/batchdeposithuff","last_synced_at":"2025-04-12T06:15:04.311Z","repository":{"id":197097047,"uuid":"697851541","full_name":"0xvv/BatchDepositHuff","owner":"0xvv","description":"Efficient beacon chain batch deposit contract written in huff","archived":false,"fork":false,"pushed_at":"2023-10-01T20:39:57.000Z","size":63,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T06:14:51.239Z","etag":null,"topics":["batch-deposit","eth2-beacon-chain","evm","huff"],"latest_commit_sha":null,"homepage":"","language":"Solidity","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/0xvv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-09-28T15:49:02.000Z","updated_at":"2025-01-10T21:02:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7ccf202-bbb1-4b89-a885-a0f7b10f548a","html_url":"https://github.com/0xvv/BatchDepositHuff","commit_stats":null,"previous_names":["0xvv/batchdeposithuff"],"tags_count":0,"template":false,"template_full_name":"huff-language/huff-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvv%2FBatchDepositHuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvv%2FBatchDepositHuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvv%2FBatchDepositHuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvv%2FBatchDepositHuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xvv","download_url":"https://codeload.github.com/0xvv/BatchDepositHuff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525138,"owners_count":21118619,"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":["batch-deposit","eth2-beacon-chain","evm","huff"],"created_at":"2025-02-20T18:37:08.839Z","updated_at":"2025-04-12T06:15:04.280Z","avatar_url":"https://github.com/0xvv.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Batch deposit Huff\n\nThis repo contains 2 smart contracts that allow to batch deposit validators in the beacon chain deposit contract.\n\n### Requirements\n\nThe following will need to be installed in order to use this repo.\n\n-   [Foundry / Foundryup](https://github.com/gakonst/foundry)\n-   [Huff Compiler](https://docs.huff.sh/get-started/installing/)\n\n## Quickstart\n\n```\nforge install\nforge test\n```\n\nTo run the benchmark script :\n```\nFORK_URL=$ETH_RPC_URL make benchmark\n```\n\n## Usage\nOnly the arguments encoding matter, the signature is not checked.\nIf you wish to deploy the contract, on a testnet you have to change the hard-coded deposit contract address in the contract.\n\n### HuffClassic interface :\n``` \nanySignature(bytes pubkeys, bytes withdrawal_creds, bytes signatures, bytes32[] deposit_data_roots)\n```\n- `pubkeys` : concatenation of the public keys of the validators\n- `withdrawal_creds` : concatenation of the withdrawal credentials of the validators\n- `signatures` : concatenation of the signatures of the validators\n- `deposit_data_roots` : concatenation of the deposit data roots of the validators\n\n### HuffCompact interface :\n```\nany_signature(bytes data) \n```\n- `data` : concatenation of the concatenations of the pubkey, withdrawal_cred, signature and deposit_data_root of each validator\n\n## Benchmark\nRan against a fork at block `18255674`\n\n### Summary\n```\n┌────────┬───────────┬───────────┬───────────┐\n│ count  │  compact  │  classic  │ solidity  │\n├────────┼───────────┼───────────┼───────────┤\n│      1 │    65 605 │    66 730 │    76 074 │\n│      2 │    91 302 │    92 441 │   107 877 │\n│      3 │   120 344 │   121 521 │   142 933 │\n│      4 │   144 104 │   145 307 │   172 835 │\n│      5 │   176 922 │   178 163 │   211 715 │\n│     10 │   307 011 │   308 406 │   372 342 │\n│     20 │   589 729 │   591 372 │   715 792 │\n│     30 │   845 282 │   847 197 │ 1 032 305 │\n│     40 │ 1 118 022 │ 1 120 173 │ 1 365 669 │\n│     50 │ 1 393 065 │ 1 395 488 │ 1 701 816 │\n│     75 │ 2 050 698 │ 2 053 783 │ 2 511 743 │\n│    100 │ 2 726 240 │ 2 729 963 │ 3 338 663 │\n│    200 │ 5 411 233 │ 5 417 544 │ 6 631 612 │\n└────────┴───────────┴───────────┴───────────┘\n```\n\n### Gas savings compared to solidity implementation :\n\n```\n┌──────────────┬─────────┬─────────────┐\n│ compact (%)  │  count  │ classic (%) │\n├──────────────┼─────────┼─────────────┤\n│           14 │       1 │        12.3 │\n│         15.4 │       2 │        14.3 │\n│         15.8 │       3 │        15.0 │\n│         16.6 │       4 │        15.9 │\n│         16.4 │       5 │        15.8 │\n│         17.5 │      10 │        17.2 │\n│         17.6 │      20 │        17.4 │\n│         18.1 │      30 │        17.9 │\n│         18.1 │      40 │        18.0 │\n│         18.1 │      50 │        18.0 │\n│         18.4 │      75 │        18.2 │\n│         18.3 │     100 │        18.2 │\n│         18.4 │     200 │        18.3 │\n└──────────────┴─────────┴─────────────┘\n``````\n### Benchmark results HuffCompact :\n```\n1    =\u003e 65605\n2    =\u003e 91302\n3    =\u003e 120344\n4    =\u003e 144104\n5    =\u003e 176922\n10   =\u003e 307011\n20   =\u003e 589729\n30   =\u003e 845282\n40   =\u003e 1118022\n50   =\u003e 1393065\n75   =\u003e 2050698\n100  =\u003e 2726240\n200  =\u003e 5411233\n```\n\n### Benchmark results HuffClassic :\n```\n1    =\u003e 66730\n2    =\u003e 92441\n3    =\u003e 121521\n4    =\u003e 145307\n5    =\u003e 178163\n10   =\u003e 308406\n20   =\u003e 591372\n30   =\u003e 847197\n40   =\u003e 1120173\n50   =\u003e 1395488\n75   =\u003e 2053783\n100  =\u003e 2729963\n200  =\u003e 5417544\n```\n\n### Benchmark results [Solidity](https://etherscan.io/address/0x9b8c989FF27e948F55B53Bb19B3cC1947852E394#code) :\n```\n1    =\u003e 76074\n2    =\u003e 107877\n3    =\u003e 142933\n4    =\u003e 172835\n5    =\u003e 211715\n10   =\u003e 372342\n20   =\u003e 715792\n30   =\u003e 1032305\n40   =\u003e 1365669\n50   =\u003e 1701816\n75   =\u003e 2511743\n100  =\u003e 3338663\n200  =\u003e 6631612\n```\n\n\n## Disclaimer\n\n_These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xvv%2Fbatchdeposithuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xvv%2Fbatchdeposithuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xvv%2Fbatchdeposithuff/lists"}