# poseidon-sol

> implementation of Poseidon hash function in Solidity

Latest version **0.1.1** (published 2023-05-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install poseidon-sol
pnpm add poseidon-sol
yarn add poseidon-sol
bun add poseidon-sol
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-05-05 |
| First published | 2023-05-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 16 <20 |
| Dependencies | 0 |
| Unpacked size | 39.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Yuriko Nishiijima |
| Maintainers | yuriko627 |
| Keywords | hash function, zero-knowledge proof, ethereum, solidity |

## Links

- npm: https://www.npmjs.com/package/poseidon-sol
- Repository: https://github.com/yuriko627/poseidon-sol
- Homepage: https://github.com/yuriko627/poseidon-sol#readme
- Issues: https://github.com/yuriko627/poseidon-sol/issues
- npm.io page: https://npm.io/package/poseidon-sol

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2023-05-05

## README

# poseidon-sol

## Overview

Poseidon Hash Function implementation in Solidity

![](https://img.shields.io/hexpm/l/plug?color=green)
![GitHub issues](https://img.shields.io/github/issues/yuriko627/poseidon-sol)
[![Build Status](https://github.com/yuriko627/poseidon-sol/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/yuriko627/poseidon-sol/actions?query=workflow%3A%22Build+Status%2)
[![codecov](https://codecov.io/gh/yuriko627/poseidon-sol/branch/main/graph/badge.svg)](https://codecov.io/gh/yuriko627/poseidon-sol)

## Description

Currently, the most widely-used Poseidon hash function for EVM is implemented in JS, and it is performant but it could be more unreadable. Also, if you write a smart contract in Solidity, it has to link the bytecode or call an external contract address for hash functions, which is inconvenient.

In the future, Poseidon hash might be implemented as a precompile contract in the Ethereum protocol (https://eips.ethereum.org/EIPS/eip-5988), so that people can call it with cheap gas. However, I think it would still be valuable to have a Poseidon Solidity implementation as a baseline for the performance benchmark.

## How to use
- `npm install poseidon-sol`: install 

## How to test
- `npm install`
- `npx hardhat test`

## Other commands
-  `npx hardhat compile`
-  `npx hardhat coverage`

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