{"id":21820143,"url":"https://github.com/5afe/storageless-account","last_synced_at":"2025-09-09T22:45:16.622Z","repository":{"id":220858061,"uuid":"752775693","full_name":"5afe/storageless-account","owner":"5afe","description":"Proof of Concept Storageless Upgradable Smart Account","archived":false,"fork":false,"pushed_at":"2024-02-04T19:24:04.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T08:32:57.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5afe.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}},"created_at":"2024-02-04T19:13:09.000Z","updated_at":"2024-02-04T20:05:04.000Z","dependencies_parsed_at":"2024-02-10T02:30:21.358Z","dependency_job_id":null,"html_url":"https://github.com/5afe/storageless-account","commit_stats":null,"previous_names":["5afe/storageless-account"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/5afe/storageless-account","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fstorageless-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fstorageless-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fstorageless-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fstorageless-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5afe","download_url":"https://codeload.github.com/5afe/storageless-account/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fstorageless-account/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265645403,"owners_count":23804184,"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":[],"created_at":"2024-11-27T16:28:50.503Z","updated_at":"2025-07-17T18:32:13.853Z","avatar_url":"https://github.com/5afe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storageless Account\n\nThis repository includes a proof of concept of a smart account that does not use\nany storage during regular operation. That is, the account itself does not read\nstorage when checking signatures, potentially allowing for nested smart accounts\nto be used.\n\nIt works by using `CREATE2` magic to ensure that an account always appears at a\nparticular address, and includes the configuration directly in the proxy code.\nThis configuration gets appended to calls that are proxied to the account\nimplementation, so that it can be read from calldata instead of requiring\nstorage reads (in fact, it is very gas efficient). Changing configuration works\nby registering a new account data with the proxy factory, and then\n`SELFDESTRUCT`-ing. The next time the account is created, it will use the\nregistered configuration instead of the configuration that was passed to the\nproxy creation. This means that:\n\n- An initial configuration uniquely identifies the address of the account\n- Configuration changes keep the account on the same address\n- **Unfortunately**, it requires a staked factory for deploying accounts with\n  `initCode` because of ERC-4337 storage restrictions (reading the registered\n  new configuration on the factory contract)\n\nNote that `SELFDESTRUCT` removes account storage, so you cannot store the new\naccount data in the account's own storage.\n\n## Is This Useful?\n\n**No.** In particular, this makes use of the `SELFDESTRUCT` op-code which is not\nonly deprecated, but will stop working as of the upcoming Devcun hardfork.\n\nThat being said, there is _some_ merit to `AccountData` contract introduced in\nthis repo. In particular, full account configurations can be backed by code\ninstead of storage slots, which gives you two benefits:\n\n- For large configurations, it can be more gas efficient\n- The entire configuration of an account can be checked (for example, you can\n  check that after a `DELEGATECALL` the configuration stays the same).\n\n## Why All The Assembly?\n\nThere is hand-rolled assembly bytecode (not just Solidity `assembly` blocks) in\nthe code. The reason for this, is that both the `AccountProxy` and `AccountData`\nrequire `immutable` dynamic type support which is **not** supported by the\nSolidity compiler. Essentially, this works by just appending the dynamic types\nto the contract bytecode, and representing the data as a pair of start offset\nand byte length, roughly equivalent to the following Solidity:\n\n```solidity\nuint256 immutable private dataStart;\nuint256 immutable private dataLength;\n\nfunction data() private view returns (bytes memory blob) {\n    blob = new bytes(dataLength);\n    assembly (\"memory-safe\") {\n        codecopy(add(blob, 32), dataStart, dataLength)\n    }\n}\n```\n\nHopefully Solidity will support `immutable`s with dynamic types someday! With\nthis support, both contracts can be implemented in Solidity and not require\nhand-rolled assembly (even if it is fun to write).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5afe%2Fstorageless-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5afe%2Fstorageless-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5afe%2Fstorageless-account/lists"}