web3-tools: Tools for working with Crypto/Web3

[ blockchain, crypto, eth, ethereum, library, mit, web3 ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README on GitHub at https://github.com/gtollini/web3-tools#readme


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Dependencies base (>=4.7 && <5), bytestring (>=0.11.5 && <0.13), crypton (>=1.0.4 && <1.1), memory (>=0.18.0 && <0.19), secp256k1-haskell (>=1.4.6 && <1.5) [details]
License MIT
Copyright 2025 Gabriel Tollini
Author Gabriel Tollini
Maintainer gabrieltollini@hotmail.com
Category Web3, Crypto, Ethereum, Eth, Blockchain
Home page https://github.com/gtollini/web3-tools#readme
Bug tracker https://github.com/gtollini/web3-tools/issues
Source repo head: git clone https://github.com/gtollini/web3-tools
Uploaded by gtollini at 2025-11-18T05:25:15Z
Distributions
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2025-11-18 [all 2 reports]

Readme for web3-tools-0.1.0.0

[back to package description]

web3-tools

CI

A Haskell library providing simple, reusable cryptographic utilities for Web3 development.

This is a small, focused library that I maintain and expand as needed. Contributions, feature requests, and suggestions are always welcome!

Features

  • Ethereum signature verification - Verify ECDSA signatures against addresses
  • Address recovery - Recover Ethereum addresses from message signatures
  • Secp256k1 operations - Low-level elliptic curve cryptography via FFI
  • Keccak256 hashing - Ethereum-compatible hash function

Module Structure

The library is organized to separate chain-agnostic crypto primitives from blockchain-specific implementations:

Crypto.*              -- Shared cryptographic primitives
  Crypto.Hash.Keccak  -- Keccak256 hashing
  Crypto.Secp256k1.*  -- Elliptic curve operations

Eth.*                 -- Ethereum-specific functionality
  Eth.Address         -- Signature verification and address recovery

This makes it easy to add support for other blockchains while reusing common cryptographic building blocks.

Installation

Requirements:

  • libsecp256k1-devel (or libsecp256k1-dev on Debian/Ubuntu)

Using Stack:

stack build

Usage Example

{-# LANGUAGE OverloadedStrings #-}
import Eth.Address (verifySignature)

-- Verify an Ethereum signature
main :: IO ()
main = do
  let message = "Hello, Web3!"
      signature = ... -- 65-byte signature (r || s || v)
      address = ...   -- 20-byte Ethereum address

  isValid <- verifySignature message signature address
  print isValid

Contributing

This library grows based on practical needs. If you:

  • Need a specific feature for your project
  • Found a bug or issue
  • Have suggestions for improvements
  • Want to add support for another blockchain

Feel free to open an issue or submit a PR!

License

MIT - See LICENSE file for details