This repository is a proof-of-concept adaptation of the ERC-4337 account-abstraction codebase. It keeps the standard EntryPoint and SimpleAccount stack from Infinitism and adds an experimental Falcon-based account implementation to explore post-quantum signature verification inside the ERC-4337 execution model.
In practice, this repo is best understood as two things at once:
- a working ERC-4337 reference-style sandbox built around the usual
EntryPointflow - a Falcon signature experiment layered on top of that base
- Core ERC-4337 contracts:
EntryPoint,BaseAccount, paymaster, nonce, staking, and sender-creation infrastructure - Standard sample account path:
SimpleAccountplusSimpleAccountFactory - Falcon experiment:
FalconSimpleAccountplusZKNOX_*verification helpers - TypeScript tooling for packing, signing, simulating, and sending
UserOperations - Hardhat deploy scripts, runtime demo scripts, gas measurement scripts, and tests
The package metadata under contracts/package.json still tracks the Infinitism account-abstraction package lineage, while this repository's root setup and tests introduce the Falcon-specific work.
The standard ERC-4337 code in this repo is the foundation. The Falcon work is an experiment that uses the account-abstraction model to swap the normal ECDSA account validation step for Falcon verification.
That distinction matters because:
- the default deploy scripts still deploy the standard
SimpleAccountflow - the TypeScript runtime helpers still target the standard account/factory path
- the Falcon path currently lives in a dedicated sample contract and a focused test
So this is not a fully Falcon-native account-abstraction stack yet. It is a standard ERC-4337 codebase with an experimental Falcon account implementation.
At a high level, the execution flow is:
- A
UserOperationis assembled in TypeScript. - The operation is packed and hashed according to the ERC-4337 domain.
- A bundler, local sender, or test harness submits it to
EntryPoint. EntryPointvalidates prefund, nonce, paymaster data, and callsaccount.validateUserOp(...).- The account implementation decides whether the signature scheme is valid.
- If validation passes,
EntryPointexecutes the requested call and charges gas from deposit/prefund.
The key extension point is the account's _validateSignature(...) implementation:
SimpleAccountuses ECDSA recoveryFalconSimpleAccountattempts Falcon verification through the ZKNOX helper contracts
contracts/core/EntryPoint.sol: singleton entry point for validation, execution, fee accounting, and bundler-facing flowscontracts/core/BaseAccount.sol: shared account-sidevalidateUserOpskeletoncontracts/core/BasePaymaster.sol: paymaster foundationcontracts/core/NonceManager.sol: nonce handlingcontracts/core/StakeManager.sol: deposits and stake lifecyclecontracts/core/SenderCreator.sol: controlled account deployment helper
contracts/samples/SimpleAccount.sol: UUPS-upgradeable sample smart account that validates with ECDSAcontracts/samples/SimpleAccountFactory.sol: deterministic ERC1967 proxy factory forSimpleAccountdeploy/1_deploy_entrypoint.ts: deploysEntryPointdeploy/2_deploy_SimpleAccountFactory.ts: deploysSimpleAccountFactoryandTestCounteron local networks
contracts/samples/FalconSimpleAccount.sol: sample account that stores Falcon public-key material and uses Falcon verification duringvalidateUserOpcontracts/samples/ZKNOX_falcon.sol: Falcon verification logiccontracts/samples/ZKNOX_NTT.sol: NTT-related math used by the Falcon verifiercontracts/samples/HashToPoint_ZKNOX.sol: hash-to-point helpercontracts/samples/FalconConstants.sol: constants used by the Falcon implementation
test/UserOp.ts: pack, hash, fill, and sign user operationstest/testutils.ts: shared test helpers, deploy helpers, revert decoding, funding helperssrc/AASigner.ts: account-abstraction aware signer and user-op senderssrc/runop.ts: runnable example that deploys default contracts when needed and sends a sample operationsrc/Create2Factory.ts: deterministic deployment helper
The current TypeScript tooling is centered on the standard SimpleAccount path. The Falcon path is not yet wired into AASigner, the standard factory flow, or the default runtime script.
contracts/
core/ ERC-4337 core contracts
interfaces/ contract interfaces and packed user-op types
legacy/ compatibility interfaces for older versions
samples/ sample accounts, callback handlers, Falcon experiment
test/ Solidity test helper contracts
deploy/ hardhat-deploy scripts
src/ runtime helpers and demo script
test/ Hardhat/TypeScript test suite
gascalc/ gas-reporting tests and helpers
audits/ audit PDFs included with the repo
reports/ generated gas checker output
scripts/ wrappers, packaging scripts, gas scripts
This repository depends on a local sibling package:
"falcon-sign": "file:../falcon-sign-js"You need to clone it first:
cd ..
git clone https://github.com/asanso/falcon-sign-js.git
cd account-abstraction
yarn installThe original short README note about this dependency is important: without ../falcon-sign-js, yarn install will fail.
The repo can also use these environment variables:
MNEMONIC_FILE: file containing the mnemonic for configured non-local networksINFURA_ID: Infura project id for the configuredgoerliandsepolianetworksETHERSCAN_API_KEY: verification key for Etherscan plugin usageSALT: deterministic deployment salt overrideAA_URL: external endpoint supportingeth_sendUserOperationforsrc/runop.tsAA_INDEX: account index used byAASigner
yarn compile
yarn test
yarn test test/falcon-simple-wallet.test.ts
yarn run runop
yarn gas-calc
yarn coverage
yarn lintWhat those commands do:
yarn compile: compile contracts through the Hardhat wrapperyarn test: run the Hardhat test suiteyarn test test/falcon-simple-wallet.test.ts: run the Falcon-focused validation testyarn run runop: run the demo AA flow using the defaultSimpleAccountsetupyarn gas-calc: generate gas reportsyarn coverage: run Solidity coverageyarn lint: run Solidity and JS/TS linting
- The core ERC-4337
EntryPointflow - The standard
SimpleAccountandSimpleAccountFactorypath - Local deployment via
hardhat-deploy - TypeScript helpers for packing, signing, and sending standard user operations
- Extensive upstream-style tests for entry point, paymaster, gas, and account behavior
The Falcon work is the distinctive part of this repository, but it is still experimental.
Today, the Falcon path looks like this:
FalconSimpleAccountstores Falcon public-key data on the account- verification is delegated to the
ZKNOX_falconhelper stack - the main Falcon sanity coverage is in
test/falcon-simple-wallet.test.ts - the Falcon account is manually deployed in the test rather than deployed through the default factory path
- The default deployment flow does not deploy a Falcon factory or Falcon account.
- The default runtime tooling still assumes the standard
SimpleAccount. - The Falcon validation path currently contains a temporary workaround for signature encoding compatibility between
falcon-sign-jsand the Solidity verifier. - In the current Falcon test flow,
userOp.callDatais reused to carry Falcon salt into the verifier. - The Falcon test directly exercises
validateUserOpon a manually deployed proxy-backed account rather than a fully integrated factory-plus-bundler path.
That means the Falcon code should be treated as a proof of concept rather than a production-ready account implementation.
The test suite mixes several layers of coverage:
- core ERC-4337 behavior tests such as
test/entrypoint.test.ts - standard account behavior tests such as
test/simple-wallet.test.ts - helper and utility tests
- a Falcon-specific validation test in
test/falcon-simple-wallet.test.ts
CI is configured in .github/workflows/build.yml to run compile, typecheck, tests, gas checks, lint, and coverage.