# @runonflux/account-abstraction

> Account Abstraction Schnorr Multi-Signatures

Latest version **1.2.1** (published 2025-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @runonflux/account-abstraction
pnpm add @runonflux/account-abstraction
yarn add @runonflux/account-abstraction
bun add @runonflux/account-abstraction
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2025-03-29 |
| First published | 2024-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 21 |
| Unpacked size | 975.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | thetrunk, bill2 |
| Keywords | Account Abstraction, AA, ERC-4337, Schnorr, Signature, Multisig |

## Links

- npm: https://www.npmjs.com/package/@runonflux/account-abstraction
- Repository: https://github.com/RunOnFlux/account-abstraction
- Homepage: https://github.com/RunOnFlux/account-abstraction#readme
- Issues: https://github.com/RunOnFlux/account-abstraction/issues
- npm.io page: https://npm.io/package/@runonflux/account-abstraction

## Dependencies (21)

- [ajv](https://npm.io/package/ajv.md) ^8.17.1
- [bigi](https://npm.io/package/bigi.md) ^1.4.2
- [viem](https://npm.io/package/viem.md) ^2.24.2
- [ecurve](https://npm.io/package/ecurve.md) ^1.0.6
- [ethers](https://npm.io/package/ethers.md) ^6.13.5
- [hardhat](https://npm.io/package/hardhat.md) ^2.22.19
- [secp256k1](https://npm.io/package/secp256k1.md) ^5.0.1
- [typechain](https://npm.io/package/typechain.md) ^8.3.2
- [hardhat-deploy](https://npm.io/package/hardhat-deploy.md) ^0.14.0
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^7.1.5
- [@alchemy/aa-core](https://npm.io/package/@alchemy/aa-core.md) ^3.19.0
- [@typechain/hardhat](https://npm.io/package/@typechain/hardhat.md) ^9.1.0
- [@typechain/ethers-v6](https://npm.io/package/@typechain/ethers-v6.md) ^0.5.1
- [hardhat-abi-exporter](https://npm.io/package/hardhat-abi-exporter.md) ^2.10.1
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) ~5.0.2
- [hardhat-dependency-compiler](https://npm.io/package/hardhat-dependency-compiler.md) ^1.2.1
- [@openzeppelin/hardhat-upgrades](https://npm.io/package/@openzeppelin/hardhat-upgrades.md) ^3.9.0
- [@nomicfoundation/hardhat-ethers](https://npm.io/package/@nomicfoundation/hardhat-ethers.md) ^3.0.8
- [@nomicfoundation/hardhat-verify](https://npm.io/package/@nomicfoundation/hardhat-verify.md) ^2.0.13
- [@openzeppelin/contracts-upgradeable](https://npm.io/package/@openzeppelin/contracts-upgradeable.md) ~5.0.2
- [@nomicfoundation/hardhat-network-helpers](https://npm.io/package/@nomicfoundation/hardhat-network-helpers.md) ^1.0.12

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2025-03-29
- 1.2.0 — 2025-02-21
- 1.1.1 — 2025-01-15
- 1.0.4 — 2024-10-22
- 1.0.3 — 2024-07-11
- 1.0.2 — 2024-06-27
- 1.0.0 — 2024-06-20

## README

# Account Abstraction Schnorr MultiSig

Account Abstraction - Schnorr Multi Signature ERC-4337 compliant smart contracts.

## Overview

This package provides a robust implementation of ERC-4337 Account Abstraction using Schnorr Multi-Signatures. It includes two main smart contracts:

- **MultiSigSmartAccount**: Implements the ERC-4337 Account Abstraction.
- **MultiSigSmartAccountFactory**: A factory contract for creating account abstractions.

The contracts are designed to be [UUPS Upgradeable Proxies](https://docs.openzeppelin.com/contracts/5.x/api/proxy#UUPSUpgradeable), allowing upgrades by the Owner. The Owner role is assigned to the combined public address (`combinedAddress`) during account initialization, ensuring that critical functions like upgrades or withdrawals require Schnorr Multi-signature authorization.

## Key Features

- **Secure Multi-Signature Transactions**: Utilizes Schnorr signatures for enhanced security.
- **Upgradeable Contracts**: Supports UUPS proxy pattern for contract upgrades.
- **ERC-4337 Compliance**: Adheres to the latest Ethereum standards for account abstraction.

## Requirements

- **Node.js**: Version >=18
- **npm**: Version >=9

## Installation

NPM package

```bash
npm install @runonflux/account-abstraction
```

Clone the repository and install dependencies:

```bash
git clone https://github.com/RunOnFlux/account-abstraction.git
cd account-abstraction
npm install
```

## Testing

Run the test suite using:

```bash
npm run test
```

## Deployments

Refer to the [Deployments](./deployments.md) for information about deployed contracts.

Deploy the MultiSigSmartAccount Factory on Ethereum Sepolia Testnet:

```bash
npm run deploy:sepolia
```

For other supported networks, use:

```bash
npx hardhat deploy --network <NETWORK_NAME> --tags ACCOUNT_FACTORY
```

Supported networks include:
- mainnet
- sepolia
- polygon-mainnet

## Build Package

Build the package with:

```bash
npm run prebuild
npm run build
```

The package includes:
- `abi`: Generated ABI JSON files for smart contracts.
- `deployments`: Addresses of deployed contracts for each supported network.
- `typechain`: TypeScript typings generated from ABI files.

## Associated Packages

- **[MultiSig Schnorr Signature SDK](https://www.npmjs.com/package/@runonflux/aa-schnorr-multisig-sdk)**: A TypeScript library for creating ERC-4337 Account Abstractions with Schnorr Signatures. Refer to the [SDK README](https://github.com/RunOnFlux/account-abstraction/tree/main/aa-schnorr-multisig-sdk) for usage guides and examples.

## SSP Wallet

The SSP Wallet is a multi-signature, multi-asset wallet leveraging this SDK for EVM chains. For more information and usage examples, visit the [SSP Wallet Repository](https://github.com/RunOnFlux/ssp-wallet).

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.

## Reporting Issues

Found a bug? Please report it on our [issue tracker](https://github.com/RunOnFlux/account-abstraction/issues).

## Inspiration, Credits & Acknowledgements

- *This library is based on [Borislav Itskov research](https://hackmd.io/@0xbobby/rkIGEBVb2) and draws inspiration from the [schnorrkel.js](https://github.com/borislav-itskov/schnorrkel.js) implementation.*
- *Account Abstraction ERC4337 [eth-infinitism/account-abstraction](https://github.com/eth-infinitism/account-abstraction)*

## Security Audits  

The smart contracts and SDK underwent a comprehensive security audit by [Halborn](https://halborn.com/) finalised in **February 2025**.  

### Audit Reports  

📄 **Smart Contracts Audit**  
- **[Halborn Audit Report – Smart Contracts](https://github.com/RunOnFlux/account-abstraction/blob/main/Account_Abstraction_Schnorr_MultiSig_SmartContracts_SecAudit_HALBORN.pdf)** (GitHub)  
- **[Halborn Public Report – Smart Contracts](https://www.halborn.com/audits/influx-technologies/account-abstraction-schnorr-multisig)** (Halborn)  

📄 **SDK Audit**  
- **[Halborn Audit Report – SDK](https://github.com/RunOnFlux/account-abstraction/blob/main/Account_Abstraction_Schnorr_MultiSig_SDK_SecAudit_HALBORN.pdf)** (GitHub)  
- **[Halborn Public Report – SDK](https://www.halborn.com/audits/influx-technologies/account-abstraction-schnorr-signatures-sdk)** (Halborn)  


### Findings & Notes

- **Smart Contracts:** All findings were in **unused code**, which has been **removed** in the `main` branch. Contracts were **redeployed**, and the `main` branch is recommended for production while `master` branch is an archive where audits were assessed and perfectly safe to continue using. ([Fix PR](https://github.com/RunOnFlux/account-abstraction/pull/15))  
- **SDK:** All important findigs were addressed in the `main` branch. Be noted that examples are using hard coded values, furthermore this library requires proper **nonce management** on the client side, and following a strict **error-throwing approach**. ([Fix PR](https://github.com/RunOnFlux/account-abstraction/pull/17))

---
_Source: https://npm.io/package/@runonflux/account-abstraction · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
