web3-0.8.3.1: Ethereum API for Haskell

CopyrightAlexander Krupenkin 2018
LicenseBSD3
Maintainermail@akru.me
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Crypto.Ethereum.Signature

Description

Recoverable ECC signature support.

Synopsis

Documentation

hashMessage :: ByteArrayAccess message => message -> Digest Keccak_256 Source #

Ethereum standard hashed message.

The data will be UTF-8 HEX decoded and enveloped as follows: "x19Ethereum Signed Message:n" + message.length + message and hashed using keccak256.

signMessage :: (ByteArrayAccess message, ByteArray rsv) => PrivateKey -> message -> rsv Source #

Make Ethereum standard signature.

The message is before enveloped as follows: "x19Ethereum Signed Message:n" + message.length + message

WARNING: Vulnerable to timing attacks.

signTransaction Source #

Arguments

:: ByteArray ba 
=> (Maybe (Integer, Integer, Word8) -> ba)

Two way transaction packer (unsigned and signed)

-> PrivateKey

Private key

-> ba

Encoded transaction

Sign Ethereum transaction.

WARNING: Vulnerable to timing attacks.

pack :: ByteArray rsv => (Integer, Integer, Word8) -> rsv Source #

Pack recoverable signature as byte array (65 byte length).

unpack :: ByteArrayAccess rsv => rsv -> (Integer, Integer, Word8) Source #

Unpack recoverable signature from byte array.

Input array should have 65 byte length.