Skip to main content
@tevm/voltaire
@tevm/voltaire / native

native

Enumerations

NativeErrorCode

Defined in: src/native-loader/types.ts:204 Runtime error codes from native library

Enumeration Members

BUFFER_TOO_SMALL
BUFFER_TOO_SMALL: -4
Defined in: src/native-loader/types.ts:209
DECODING_ERROR
DECODING_ERROR: -10
Defined in: src/native-loader/types.ts:215
ENCODING_ERROR
ENCODING_ERROR: -9
Defined in: src/native-loader/types.ts:214
INVALID_CHECKSUM
INVALID_CHECKSUM: -3
Defined in: src/native-loader/types.ts:208
INVALID_HEX
INVALID_HEX: -1
Defined in: src/native-loader/types.ts:206
INVALID_LENGTH
INVALID_LENGTH: -2
Defined in: src/native-loader/types.ts:207
INVALID_PRIVATE_KEY
INVALID_PRIVATE_KEY: -7
Defined in: src/native-loader/types.ts:212
INVALID_PUBLIC_KEY
INVALID_PUBLIC_KEY: -8
Defined in: src/native-loader/types.ts:213
INVALID_RECOVERY_ID
INVALID_RECOVERY_ID: -6
Defined in: src/native-loader/types.ts:211
INVALID_SIGNATURE
INVALID_SIGNATURE: -5
Defined in: src/native-loader/types.ts:210
NULL_POINTER
NULL_POINTER: -11
Defined in: src/native-loader/types.ts:216
OUT_OF_MEMORY
OUT_OF_MEMORY: -12
Defined in: src/native-loader/types.ts:217
SUCCESS
SUCCESS: 0
Defined in: src/native-loader/types.ts:205
UNKNOWN_ERROR
UNKNOWN_ERROR: -99
Defined in: src/native-loader/types.ts:218

Type Aliases

Platform

Platform = "darwin-arm64" | "darwin-x64" | "linux-arm64" | "linux-x64" | "win32-x64"
Defined in: src/native-loader/platform.ts:5 Platform detection utilities for native bindings

Variables

Keccak256

const Keccak256: (input) => Promise<Keccak256Hash> & object = Keccak256Hash
Defined in: src/crypto/Keccak256/Keccak256.native.ts:150

Type Declaration

DIGEST_SIZE
DIGEST_SIZE: number = 32
from()
from: (input) => Promise<Keccak256Hash>
Universal constructor - accepts hex, string, or bytes
Parameters
input
Hex string, UTF-8 string, or Uint8Array string | Uint8Array<ArrayBufferLike>
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
fromHex()
fromHex: (hex) => Promise<Keccak256Hash> = hashHex
Hash hex string with Keccak-256 using native implementation
Parameters
hex
string Hex string to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
fromString()
fromString: (str) => Promise<Keccak256Hash> = hashString
Hash UTF-8 string with Keccak-256 using native implementation
Parameters
str
string String to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hash()
hash: (data) => Promise<Keccak256Hash>
Hash data with Keccak-256 using native implementation
Parameters
data
Uint8Array Data to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashHex()
hashHex: (hex) => Promise<Keccak256Hash>
Hash hex string with Keccak-256 using native implementation
Parameters
hex
string Hex string to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashString()
hashString: (str) => Promise<Keccak256Hash>
Hash UTF-8 string with Keccak-256 using native implementation
Parameters
str
string String to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashSync()
hashSync: (data) => Keccak256Hash
Synchronous hash (for backward compatibility) Throws if native library not loaded
Parameters
data
Uint8Array
Returns
Keccak256Hash
RATE
RATE: number = 136
selector()
selector: (signature) => Promise<string>
Compute function selector (first 4 bytes of keccak256)
Parameters
signature
string Function signature (e.g., “transfer(address,uint256)“)
Returns
Promise<string> First 4 bytes of hash as hex string
STATE_SIZE
STATE_SIZE: number = 200
topic()
topic: (signature) => Promise<Keccak256Hash>
Compute event topic hash
Parameters
signature
string Event signature (e.g., “Transfer(address,address,uint256)“)
Returns
Promise<Keccak256Hash> 32-byte topic hash

Keccak256HashNative

const Keccak256HashNative: (input) => Promise<Keccak256Hash> & object
Defined in: src/crypto/Keccak256/Keccak256.native.ts:134 Native Keccak256 namespace object

Type Declaration

DIGEST_SIZE
DIGEST_SIZE: number = 32
from()
from: (input) => Promise<Keccak256Hash>
Universal constructor - accepts hex, string, or bytes
Parameters
input
Hex string, UTF-8 string, or Uint8Array string | Uint8Array<ArrayBufferLike>
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
fromHex()
fromHex: (hex) => Promise<Keccak256Hash> = hashHex
Hash hex string with Keccak-256 using native implementation
Parameters
hex
string Hex string to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
fromString()
fromString: (str) => Promise<Keccak256Hash> = hashString
Hash UTF-8 string with Keccak-256 using native implementation
Parameters
str
string String to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hash()
hash: (data) => Promise<Keccak256Hash>
Hash data with Keccak-256 using native implementation
Parameters
data
Uint8Array Data to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashHex()
hashHex: (hex) => Promise<Keccak256Hash>
Hash hex string with Keccak-256 using native implementation
Parameters
hex
string Hex string to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashString()
hashString: (str) => Promise<Keccak256Hash>
Hash UTF-8 string with Keccak-256 using native implementation
Parameters
str
string String to hash
Returns
Promise<Keccak256Hash> 32-byte hash
Throws
Error if native operation fails
hashSync()
hashSync: (data) => Keccak256Hash
Synchronous hash (for backward compatibility) Throws if native library not loaded
Parameters
data
Uint8Array
Returns
Keccak256Hash
RATE
RATE: number = 136
selector()
selector: (signature) => Promise<string>
Compute function selector (first 4 bytes of keccak256)
Parameters
signature
string Function signature (e.g., “transfer(address,uint256)“)
Returns
Promise<string> First 4 bytes of hash as hex string
STATE_SIZE
STATE_SIZE: number = 200
topic()
topic: (signature) => Promise<Keccak256Hash>
Compute event topic hash
Parameters
signature
string Event signature (e.g., “Transfer(address,address,uint256)“)
Returns
Promise<Keccak256Hash> 32-byte topic hash

nativeAPI

const nativeAPI: object
Defined in: src/native/index.ts:376 Native API object - satisfies VoltaireAPI interface This ensures compile-time errors if the native API doesn’t have all required namespaces. Note: The actual Keccak256 export is the native async version from Keccak256.native.js, but we use JS Keccak256 here for type checking since native methods are async.

Type Declaration

Abi
Abi: typeof Abi
AccessList
AccessList: object
Namespace for AccessList operations
AccessList.ADDRESS_COST
ADDRESS_COST: bigint
Gas cost per address in access list (EIP-2930)
AccessList.addressCount()
addressCount: (list) => number
Parameters
list
BrandedAccessList
Returns
number
AccessList.assertValid()
assertValid: (list) => void
Parameters
list
BrandedAccessList
Returns
void
AccessList.COLD_ACCOUNT_ACCESS_COST
COLD_ACCOUNT_ACCESS_COST: bigint
Cold account access cost (pre-EIP-2930)
AccessList.COLD_STORAGE_ACCESS_COST
COLD_STORAGE_ACCESS_COST: bigint
Cold storage access cost (pre-EIP-2930)
AccessList.create()
create: () => BrandedAccessList
Returns
BrandedAccessList
AccessList.deduplicate()
deduplicate: (list) => BrandedAccessList
Parameters
list
BrandedAccessList
Returns
BrandedAccessList
AccessList.from()
from: (value) => BrandedAccessList
Parameters
value
Uint8Array<ArrayBufferLike> | readonly Item[]
Returns
BrandedAccessList
AccessList.fromBytes()
fromBytes: (bytes) => BrandedAccessList
Parameters
bytes
Uint8Array
Returns
BrandedAccessList
AccessList.gasCost()
gasCost: (list) => bigint
Parameters
list
BrandedAccessList
Returns
bigint
AccessList.gasSavings()
gasSavings: (list) => bigint
Parameters
list
BrandedAccessList
Returns
bigint
AccessList.hasSavings()
hasSavings: (list) => boolean
Parameters
list
BrandedAccessList
Returns
boolean
AccessList.includesAddress()
includesAddress: (list, address) => boolean
Parameters
list
BrandedAccessList
address
AddressType
Returns
boolean
AccessList.includesStorageKey()
includesStorageKey: (list, address, storageKey) => boolean
Parameters
list
BrandedAccessList
address
AddressType
storageKey
HashType
Returns
boolean
AccessList.is()
is: (value) => value is BrandedAccessList
Parameters
value
unknown
Returns
value is BrandedAccessList
AccessList.isEmpty()
isEmpty: (list) => boolean
Parameters
list
BrandedAccessList
Returns
boolean
AccessList.isItem()
isItem: (value) => value is Item
Parameters
value
unknown
Returns
value is Item
AccessList.keysFor()
keysFor: (list, address) => readonly HashType[] | undefined
Parameters
list
BrandedAccessList
address
AddressType
Returns
readonly HashType[] | undefined
AccessList.merge()
merge: (…accessLists) => BrandedAccessList
Parameters
accessLists
BrandedAccessList[]
Returns
BrandedAccessList
AccessList.STORAGE_KEY_COST
STORAGE_KEY_COST: bigint
Gas cost per storage key in access list (EIP-2930)
AccessList.storageKeyCount()
storageKeyCount: (list) => number
Parameters
list
BrandedAccessList
Returns
number
AccessList.toBytes()
toBytes: (list) => Uint8Array
Parameters
list
BrandedAccessList
Returns
Uint8Array
AccessList.WARM_STORAGE_ACCESS_COST
WARM_STORAGE_ACCESS_COST: bigint
Warm storage access cost (post-EIP-2929)
AccessList.withAddress()
withAddress: (list, address) => BrandedAccessList
Parameters
list
BrandedAccessList
address
AddressType
Returns
BrandedAccessList
AccessList.withStorageKey()
withStorageKey: (list, address, storageKey) => BrandedAccessList
Parameters
list
BrandedAccessList
address
AddressType
storageKey
HashType
Returns
BrandedAccessList
Address
Address: typeof Address
Blake2
Blake2: (input, outputLength?) => Blake2Hash & object
Type Declaration
from()
from: (input, outputLength?) => Blake2Hash
Hash input with BLAKE2b (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string: UTF-8 encode then hash
Parameters
input
Data to hash string | Uint8Array<ArrayBufferLike>
outputLength?
number = 64 Output length in bytes (1-64, default 64)
Returns
Blake2Hash BLAKE2b hash
See
https://voltaire.tevm.sh/crypto/blake2 for crypto documentation
Since
0.0.0
Throws
If outputLength is invalid
Example
import { Blake2Hash } from './crypto/Blake2/index.js';

const hash1 = Blake2Hash.from("hello");              // String, 64 bytes
const hash2 = Blake2Hash.from("hello", 32);          // String, 32 bytes
const hash3 = Blake2Hash.from(uint8array);           // Bytes, 64 bytes
const hash4 = Blake2Hash.from(uint8array, 48);       // Bytes, 48 bytes
fromString()
fromString: (str, outputLength?) => Blake2Hash = hashString
Hash string with BLAKE2b (convenience function)
Parameters
str
string Input string to hash
outputLength?
number = 64 Output length in bytes (1-64, default 64)
Returns
Blake2Hash BLAKE2b hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If outputLength is invalid
Example
import * as Blake2 from './crypto/Blake2/index.js';
const hash = Blake2.hashString("hello world");
const hash48 = Blake2.hashString("hello world", 48);
hash()
hash: (data, outputLength?) => Blake2Hash
Hash data with BLAKE2b
Parameters
data
Input data to hash (Uint8Array or string) string | Uint8Array<ArrayBufferLike>
outputLength?
number = 64 Output length in bytes (1-64, default 64)
Returns
Blake2Hash BLAKE2b hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If outputLength is invalid
Example
import * as Blake2 from './crypto/Blake2/index.js';
const hash = Blake2.hash(new Uint8Array([1, 2, 3]));
const hash32 = Blake2.hash("hello", 32);
hashString()
hashString: (str, outputLength?) => Blake2Hash
Hash string with BLAKE2b (convenience function)
Parameters
str
string Input string to hash
outputLength?
number = 64 Output length in bytes (1-64, default 64)
Returns
Blake2Hash BLAKE2b hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If outputLength is invalid
Example
import * as Blake2 from './crypto/Blake2/index.js';
const hash = Blake2.hashString("hello world");
const hash48 = Blake2.hashString("hello world", 48);
SIZE
SIZE: number
Deprecated
Use Blake2Hash instead Blake2 alias maintained for backward compatibility
Blob
Blob: typeof Blob
BloomFilter
BloomFilter: typeof BloomFilter
Bls12381
Bls12381: object
Bls12381 main export
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

// Generate keypair
const privateKey = Bls12381.randomPrivateKey();
const publicKey = Bls12381.derivePublicKey(privateKey);

// Sign and verify
const message = new TextEncoder().encode('Hello');
const signature = Bls12381.sign(message, privateKey);
const isValid = Bls12381.verify(signature, message, publicKey);
Bls12381.aggregate()
aggregate: (signatures) => Uint8Array<ArrayBufferLike>
Aggregate multiple BLS signatures into one The aggregated signature can be verified against an aggregated public key (when all signers signed the same message) or via batch verification (when signers signed different messages).
Parameters
signatures
Uint8Array<ArrayBufferLike>[] Array of compressed G1 signatures (48 bytes each)
Returns
Uint8Array<ArrayBufferLike> Aggregated signature (48 bytes compressed G1)
Throws
If aggregation fails or no signatures provided
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const message = new TextEncoder().encode('Vote for proposal');

const pk1 = Bls12381.randomPrivateKey();
const pk2 = Bls12381.randomPrivateKey();

const sig1 = Bls12381.sign(message, pk1);
const sig2 = Bls12381.sign(message, pk2);

const aggSig = Bls12381.aggregate([sig1, sig2]);
Bls12381.aggregatePublicKeys()
aggregatePublicKeys: (publicKeys) => Uint8Array<ArrayBufferLike>
Aggregate multiple public keys into one Used when multiple signers sign the same message and you want to verify against a single aggregated public key.
Parameters
publicKeys
Uint8Array<ArrayBufferLike>[] Array of compressed G2 public keys (96 bytes each)
Returns
Uint8Array<ArrayBufferLike> Aggregated public key (96 bytes compressed G2)
Throws
If aggregation fails or no public keys provided
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const pk1 = Bls12381.randomPrivateKey();
const pk2 = Bls12381.randomPrivateKey();

const pubKey1 = Bls12381.derivePublicKey(pk1);
const pubKey2 = Bls12381.derivePublicKey(pk2);

const aggPubKey = Bls12381.aggregatePublicKeys([pubKey1, pubKey2]);
Bls12381.aggregateVerify()
aggregateVerify: (aggregatedSignature, message, publicKeys) => boolean
Verify an aggregated signature where all signers signed the same message This is the most common case in Ethereum consensus - multiple validators sign the same block/attestation.
Parameters
aggregatedSignature
Uint8Array<ArrayBufferLike> Aggregated signature (96 bytes)
message
Uint8Array<ArrayBufferLike> The message that was signed by all parties
publicKeys
Uint8Array<ArrayBufferLike>[] Public keys of all signers (48 bytes each)
Returns
boolean True if the aggregated signature is valid
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const message = new TextEncoder().encode('Block attestation');

const pk1 = Bls12381.randomPrivateKey();
const pk2 = Bls12381.randomPrivateKey();
const pubKey1 = Bls12381.derivePublicKey(pk1);
const pubKey2 = Bls12381.derivePublicKey(pk2);

const sig1 = Bls12381.sign(message, pk1);
const sig2 = Bls12381.sign(message, pk2);
const aggSig = Bls12381.aggregate([sig1, sig2]);

const isValid = Bls12381.aggregateVerify(aggSig, message, [pubKey1, pubKey2]);
console.log(isValid); // true
Bls12381.batchVerify()
batchVerify: (aggregatedSignature, messages, publicKeys) => boolean
Verify an aggregated signature where each signer signed a different message Uses multi-pairing verification: product of e(pk_i, H(msg_i)) == e(G1, aggSig)
Parameters
aggregatedSignature
Uint8Array<ArrayBufferLike> Aggregated signature (96 bytes)
messages
Uint8Array<ArrayBufferLike>[] Messages that were signed (one per signer)
publicKeys
Uint8Array<ArrayBufferLike>[] Public keys (one per signer, same order as messages)
Returns
boolean True if the aggregated signature is valid
Throws
If messages and publicKeys have different lengths
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const pk1 = Bls12381.randomPrivateKey();
const pk2 = Bls12381.randomPrivateKey();
const pubKey1 = Bls12381.derivePublicKey(pk1);
const pubKey2 = Bls12381.derivePublicKey(pk2);

const msg1 = new TextEncoder().encode('Message 1');
const msg2 = new TextEncoder().encode('Message 2');

const sig1 = Bls12381.sign(msg1, pk1);
const sig2 = Bls12381.sign(msg2, pk2);
const aggSig = Bls12381.aggregate([sig1, sig2]);

const isValid = Bls12381.batchVerify(aggSig, [msg1, msg2], [pubKey1, pubKey2]);
console.log(isValid); // true
Bls12381.derivePublicKey()
derivePublicKey: (privateKey) => Uint8Array<ArrayBufferLike>
Derive a BLS12-381 public key from a private key Public key = privateKey * G2_generator
Parameters
privateKey
Uint8Array<ArrayBufferLike> 32-byte private key (scalar in Fr)
Returns
Uint8Array<ArrayBufferLike> Compressed G2 public key (96 bytes)
Throws
If private key is invalid
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const privateKey = Bls12381.randomPrivateKey();
const publicKey = Bls12381.derivePublicKey(privateKey);
console.log(publicKey.length); // 96
Bls12381.derivePublicKeyPoint()
derivePublicKeyPoint: (privateKey) => Bls12381G1PointType
Derive a BLS12-381 public key as a G1 point (uncompressed)
Parameters
privateKey
Uint8Array<ArrayBufferLike> 32-byte private key
Returns
Bls12381G1PointType Public key as G1 point
Throws
If private key is invalid
Bls12381.fastAggregateVerify()
fastAggregateVerify: (aggregatedSignature, message, aggregatedPublicKey) => boolean
Fast aggregate verify (same message case) Optimized for the common case where all signers signed the same message. This is faster than aggregateVerify when you already have the aggregated public key.
Parameters
aggregatedSignature
Uint8Array<ArrayBufferLike> Aggregated signature (96 bytes)
message
Uint8Array<ArrayBufferLike> The message that was signed
aggregatedPublicKey
Uint8Array<ArrayBufferLike> Pre-computed aggregated public key (48 bytes)
Returns
boolean True if valid
Bls12381.Fp
Fp: Fp
Bls12381.Fp2
Fp2: Fp2
Bls12381.Fr
Fr: Fr
Bls12381.G1
G1: G1
Bls12381.G2
G2: G2
Bls12381.isValidPrivateKey()
isValidPrivateKey: (privateKey) => boolean
Check if a private key is valid A valid private key must be:
  • 32 bytes
  • Non-zero
  • Less than the curve order (Fr modulus)
Parameters
privateKey
Uint8Array<ArrayBufferLike> Private key to validate
Returns
boolean True if valid
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const pk = Bls12381.randomPrivateKey();
console.log(Bls12381.isValidPrivateKey(pk)); // true

const invalid = new Uint8Array(32); // all zeros
console.log(Bls12381.isValidPrivateKey(invalid)); // false
Bls12381.Pairing
Pairing: Pairing
BLS12-381 Pairing Operations Optimal Ate pairing implementation for BLS12-381. e: G1 x G2 -> GT NOTE: Full pairing implementation requires Fp6, Fp12 tower extensions and Miller loop computation. For production use, the native blst library should be used via the Zig FFI bindings. This module provides the interface and simplified implementations for testing and educational purposes.
See
https://hackmd.io/@benjaminion/bls12-381 for pairing details
Since
0.0.0
Bls12381.randomPrivateKey()
randomPrivateKey: () => Uint8Array<ArrayBufferLike>
Generate a random BLS12-381 private key Uses cryptographically secure random number generation. The key is guaranteed to be valid (non-zero and less than curve order).
Returns
Uint8Array<ArrayBufferLike> 32-byte private key
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const privateKey = Bls12381.randomPrivateKey();
const publicKey = Bls12381.derivePublicKey(privateKey);
Bls12381.sign()
sign: (message, privateKey) => Uint8Array<ArrayBufferLike>
Sign a message using BLS12-381 Uses the Ethereum consensus “short signatures” scheme:
  • Signature = privateKey * H(message) where H maps to G1
  • Signatures are 48 bytes (compressed G1 point)
Parameters
message
Uint8Array<ArrayBufferLike> Message to sign
privateKey
Uint8Array<ArrayBufferLike> 32-byte private key (scalar in Fr)
Returns
Uint8Array<ArrayBufferLike> Signature as compressed G1 point (48 bytes)
Throws
If private key is invalid
Throws
If signing fails
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const privateKey = Bls12381.randomPrivateKey();
const message = new TextEncoder().encode('Hello, Ethereum!');
const signature = Bls12381.sign(message, privateKey);
Bls12381.signPoint()
signPoint: (messagePoint, privateKey) => Bls12381G2PointType
Sign a pre-hashed message (G2 point) using BLS12-381 For advanced use when you have already hashed the message to G2.
Parameters
messagePoint
Bls12381G2PointType Message as G2 point
privateKey
Uint8Array<ArrayBufferLike> 32-byte private key (scalar in Fr)
Returns
Bls12381G2PointType Signature as G2 point (projective)
Throws
If private key is invalid
Throws
If signing fails
Bls12381.verify()
verify: (signature, message, publicKey) => boolean
Verify a BLS12-381 signature Uses pairing check for verification.
Parameters
signature
Uint8Array<ArrayBufferLike> Compressed G1 signature (48 bytes)
message
Uint8Array<ArrayBufferLike> Original message that was signed
publicKey
Uint8Array<ArrayBufferLike> Compressed G2 public key (96 bytes)
Returns
boolean True if signature is valid
Throws
If verification fails due to invalid inputs
Example
import { Bls12381 } from './crypto/Bls12381/index.js';

const privateKey = Bls12381.randomPrivateKey();
const publicKey = Bls12381.derivePublicKey(privateKey);
const message = new TextEncoder().encode('Hello!');
const signature = Bls12381.sign(message, privateKey);

const isValid = Bls12381.verify(signature, message, publicKey);
console.log(isValid); // true
Bls12381.verifyPoint()
verifyPoint: (signaturePoint, messagePoint, publicKeyPoint) => boolean
Verify a BLS signature with pre-computed points (advanced) For use when you have already deserialized the points.
Parameters
signaturePoint
Bls12381G2PointType Signature as G2 point
messagePoint
Bls12381G2PointType Message hash as G2 point
publicKeyPoint
Bls12381G1PointType Public key as G1 point
Returns
boolean True if signature is valid
BN254
BN254: object
BN254 main export
BN254.deserializeG1()
deserializeG1: (bytes) => G1PointType
Deserialize G1 point from bytes
Parameters
bytes
Uint8Array<ArrayBufferLike> 64-byte serialization
Returns
G1PointType G1 point
See
https://voltaire.tevm.sh/crypto for BN254 cryptography documentation
Since
0.0.0
Throws
If bytes length is invalid (must be 64 bytes)
Example
import { deserializeG1 } from './crypto/bn254/deserializeG1.js';
const bytes = new Uint8Array(64);
const point = deserializeG1(bytes);
BN254.deserializeG2()
deserializeG2: (bytes) => G2PointType
Deserialize G2 point from bytes
Parameters
bytes
Uint8Array<ArrayBufferLike> 128-byte serialization
Returns
G2PointType G2 point
See
https://voltaire.tevm.sh/crypto for BN254 cryptography documentation
Since
0.0.0
Throws
If bytes length is invalid (must be 128 bytes)
Example
import { deserializeG2 } from './crypto/bn254/deserializeG2.js';
const bytes = new Uint8Array(128);
const point = deserializeG2(bytes);
BN254.Fp
Fp: __module
BN254.Fp2
Fp2: __module
BN254.Fr
Fr: __module
BN254.G1
G1: __module
BN254.G2
G2: __module
BN254.Pairing
Pairing: __module
BN254.serializeG1()
serializeG1: (point) => Uint8Array<ArrayBufferLike>
Serialize G1 point to bytes (64 bytes: x || y)
Parameters
point
G1PointType G1 point
Returns
Uint8Array<ArrayBufferLike> 64-byte serialization
See
https://voltaire.tevm.sh/crypto for BN254 cryptography documentation
Since
0.0.0
Throws
Example
import { serializeG1 } from './crypto/bn254/serializeG1.js';
import * as G1 from './crypto/bn254/G1/index.js';
const point = G1.generator();
const bytes = serializeG1(point);
BN254.serializeG2()
serializeG2: (point) => Uint8Array<ArrayBufferLike>
Serialize G2 point to bytes (128 bytes: x.c0 || x.c1 || y.c0 || y.c1)
Parameters
point
G2PointType G2 point
Returns
Uint8Array<ArrayBufferLike> 128-byte serialization
See
https://voltaire.tevm.sh/crypto for BN254 cryptography documentation
Since
0.0.0
Throws
Example
import { serializeG2 } from './crypto/bn254/serializeG2.js';
import * as G2 from './crypto/bn254/G2/index.js';
const point = G2.generator();
const bytes = serializeG2(point);
Bytecode
Bytecode: typeof Bytecode
Bytes
Bytes: typeof Bytes
Bytes32
Bytes32: typeof Bytes32
Chain
Chain: typeof Chain
Ed25519
Ed25519: object
Ed25519 Digital Signature Algorithm Edwards-curve Digital Signature Algorithm (EdDSA) using Curve25519. Fast, secure, and deterministic signatures without requiring a hash function. Used in many modern protocols including SSH, TLS 1.3, and cryptocurrency.
Example
import { Ed25519 } from './Ed25519/index.js';

// Generate keypair from seed
const seed = new Uint8Array(32); // Random seed
const keypair = Ed25519.keypairFromSeed(seed);

// Sign a message
const message = new TextEncoder().encode('Hello, world!');
const signature = Ed25519.sign(message, keypair.secretKey);

// Verify signature
const valid = Ed25519.verify(signature, message, keypair.publicKey);
Ed25519.derivePublicKey()
derivePublicKey: (secretKey) => PublicKey
Derive Ed25519 public key from secret key.
Parameters
secretKey
SecretKey 32-byte Ed25519 secret key (seed)
Returns
PublicKey 32-byte Ed25519 public key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If secret key length is invalid or derivation fails
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const secretKey = new Uint8Array(32); // Your secret key
const publicKey = Ed25519.derivePublicKey(secretKey);
Ed25519.keypairFromSeed()
keypairFromSeed: (seed) => object
Generate Ed25519 keypair from seed deterministically.
Parameters
seed
Seed 32-byte seed for deterministic keypair generation
Returns
object Object containing 32-byte secretKey and 32-byte publicKey
publicKey
publicKey: PublicKey
secretKey
secretKey: SecretKey
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If seed length is not 32 bytes
Throws
If keypair generation fails
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const seed = crypto.getRandomValues(new Uint8Array(32));
const keypair = Ed25519.keypairFromSeed(seed);
console.log(keypair.publicKey); // Uint8Array(32)
Ed25519.PUBLIC_KEY_SIZE
PUBLIC_KEY_SIZE: 32
Ed25519 public key size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Example
import { PUBLIC_KEY_SIZE } from './crypto/Ed25519/constants.js';
const publicKey = new Uint8Array(PUBLIC_KEY_SIZE);
Ed25519.SECRET_KEY_SIZE
SECRET_KEY_SIZE: 32
Ed25519 secret key size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Example
import { SECRET_KEY_SIZE } from './crypto/Ed25519/constants.js';
const secretKey = new Uint8Array(SECRET_KEY_SIZE);
Ed25519.SEED_SIZE
SEED_SIZE: 32
Ed25519 seed size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Example
import { SEED_SIZE } from './crypto/Ed25519/constants.js';
const seed = crypto.getRandomValues(new Uint8Array(SEED_SIZE));
Ed25519.sign()
sign: (message, secretKey) => Signature
Sign message with Ed25519 secret key. Produces deterministic signatures using EdDSA.
Parameters
message
Uint8Array<ArrayBufferLike> Message bytes to sign (any length)
secretKey
SecretKey 32-byte Ed25519 secret key
Returns
Signature 64-byte Ed25519 signature
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If secret key length is not 32 bytes
Throws
If signing operation fails
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const message = new TextEncoder().encode('Hello, world!');
const signature = Ed25519.sign(message, secretKey);
Ed25519.SIGNATURE_SIZE
SIGNATURE_SIZE: 64
Ed25519 signature size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Example
import { SIGNATURE_SIZE } from './crypto/Ed25519/constants.js';
const signature = new Uint8Array(SIGNATURE_SIZE);
Ed25519.validatePublicKey()
validatePublicKey: (publicKey) => boolean
Validate Ed25519 public key format and curve membership.
Parameters
publicKey
PublicKey Ed25519 public key to validate
Returns
boolean True if public key is valid and on curve, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const isValid = Ed25519.validatePublicKey(publicKey);
if (!isValid) console.log('Invalid public key');
Ed25519.validateSecretKey()
validateSecretKey: (secretKey) => boolean
Validate Ed25519 secret key format. Checks length and attempts public key derivation.
Parameters
secretKey
SecretKey Ed25519 secret key to validate
Returns
boolean True if secret key is valid (32 bytes and can derive public key), false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const isValid = Ed25519.validateSecretKey(secretKey);
if (!isValid) console.log('Invalid secret key');
Ed25519.validateSeed()
validateSeed: (seed) => boolean
Validate Ed25519 seed format. Checks if seed has correct 32-byte length.
Parameters
seed
Seed Ed25519 seed to validate
Returns
boolean True if seed is exactly 32 bytes, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const seed = crypto.getRandomValues(new Uint8Array(32));
const isValid = Ed25519.validateSeed(seed); // true
Ed25519.verify()
verify: (signature, message, publicKey) => boolean
Verify Ed25519 signature. Returns false on verification failure instead of throwing.
Parameters
signature
Signature 64-byte Ed25519 signature to verify
message
Uint8Array<ArrayBufferLike> Original message bytes that were signed
publicKey
PublicKey 32-byte Ed25519 public key
Returns
boolean True if signature is cryptographically valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If public key length is not 32 bytes
Throws
If signature length is not 64 bytes
Example
import * as Ed25519 from './crypto/Ed25519/index.js';
const valid = Ed25519.verify(signature, message, publicKey);
if (valid) console.log('Signature verified');
EIP712
EIP712: object
EIP-712 Typed Data Signing Complete implementation of EIP-712 typed structured data hashing and signing.
Example
import { EIP712 } from './EIP712.js';

// Define typed data
const typedData = {
  domain: {
    name: 'MyApp',
    version: '1',
    chainId: 1n,
    verifyingContract: contractAddress,
  },
  types: {
    Person: [
      { name: 'name', type: 'string' },
      { name: 'wallet', type: 'address' },
    ],
    Mail: [
      { name: 'from', type: 'Person' },
      { name: 'to', type: 'Person' },
      { name: 'contents', type: 'string' },
    ],
  },
  primaryType: 'Mail',
  message: {
    from: { name: 'Alice', wallet: '0x...' },
    to: { name: 'Bob', wallet: '0x...' },
    contents: 'Hello!',
  },
};

// Hash typed data
const hash = EIP712.hashTypedData(typedData);

// Sign typed data
const signature = EIP712.signTypedData(typedData, privateKey);

// Verify signature
const valid = EIP712.verifyTypedData(signature, typedData, address);
EIP712.Domain
Domain: object
EIP712.Domain.hash()
hash: (domain) => HashType = hashDomain
Parameters
domain
Domain
Returns
HashType
EIP712.encodeData()
encodeData: (primaryType, data, types) => Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
EIP712.EncodeData()
EncodeData: (deps) => (primaryType, data, types) => Uint8Array
Factory: Encode struct data according to EIP-712.
Parameters
deps
Crypto dependencies
encodeValue
(type, value, types) => Uint8Array Encode value function
hashType
(primaryType, types) => HashType Hash type function
Returns
Function that encodes data
(primaryType, data, types): Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If primaryType is not found in types
Throws
If required field is missing from data
Example
import { EncodeData } from './crypto/EIP712/encodeData.js';
import { HashType } from './hashType.js';
import { EncodeValue } from './encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encodeData = EncodeData({ hashType, encodeValue });
const types = { Person: [{ name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }] };
const encoded = encodeData('Person', { name: 'Alice', wallet: '0x...' }, types);
EIP712.encodeType()
encodeType: (primaryType, types) => string
Encode type string for EIP-712 hashing. Produces type encoding like “Mail(Person from,Person to,string contents)Person(string name,address wallet)“
Parameters
primaryType
string Primary type name to encode
types
TypeDefinitions Type definitions mapping
Returns
string Encoded type string with primary type followed by referenced types in alphabetical order
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If primaryType or any referenced type is not found
Example
import * as EIP712 from './crypto/EIP712/index.js';
const types = { Mail: [{ name: 'from', type: 'Person' }], Person: [{ name: 'name', type: 'string' }] };
const typeString = EIP712.encodeType('Mail', types);
// Returns: "Mail(Person from)Person(string name)"
EIP712.encodeValue()
encodeValue: (type, value, types) => Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
EIP712.EncodeValue()
EncodeValue: (deps) => (type, value, types) => Uint8Array
Factory: Encode single value to 32 bytes according to EIP-712. Handles primitive types, arrays, strings, bytes, and custom structs. Addresses must be pre-validated BrandedAddress types.
Parameters
deps
Crypto dependencies
hashStruct
(type, data, types) => HashType Hash struct function
keccak256
(data) => Uint8Array Keccak256 hash function
Returns
Function that encodes value
(type, value, types): Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If type is unsupported or value format is invalid
Example
import { EncodeValue } from './crypto/EIP712/encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { HashStruct } from './hashStruct.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encoded = encodeValue('uint256', 42n, types);
EIP712.format()
format: (typedData) => string
Format typed data for human-readable display.
Parameters
typedData
TypedData Typed data to format
Returns
string Human-readable multi-line string representation
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as EIP712 from './crypto/EIP712/index.js';
const formatted = EIP712.format(typedData);
console.log(formatted);
EIP712.HashDomain()
HashDomain: (deps) => (domain) => HashType
Factory: Hash EIP-712 domain separator. Only includes fields that are defined in the domain object.
Parameters
deps
Crypto dependencies
hashStruct
(primaryType, data, types) => HashType Hash struct function
Returns
Function that hashes domain
(domain): HashType
Parameters
domain
Domain
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If domain type encoding fails
Example
import { Hash as HashDomain } from './crypto/EIP712/Domain/hash.js';
import { HashStruct } from '../hashStruct.js';
import { hash as keccak256 } from '../../Keccak256/hash.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const hashDomain = HashDomain({ hashStruct });
const domain = { name: 'MyApp', version: '1', chainId: 1n };
const domainHash = hashDomain(domain);
EIP712.hashStruct()
hashStruct: (primaryType, data, types) => HashType
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
HashType
EIP712.HashStruct()
HashStruct: (deps) => (primaryType, data, types) => HashType
Factory: Hash struct according to EIP-712 specification. Computes keccak256 of the encoded struct data.
Parameters
deps
Crypto dependencies
encodeData
(primaryType, data, types) => Uint8Array Encode data function
keccak256
(data) => Uint8Array Keccak256 hash function
Returns
Function that hashes struct
(primaryType, data, types): HashType
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If type is not found
Throws
If message data is invalid
Example
import { HashStruct } from './crypto/EIP712/hashStruct.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { EncodeData } from './encodeData.js';
const encodeData = EncodeData({ hashType, encodeValue });
const hashStruct = HashStruct({ keccak256, encodeData });
const types = { Person: [{ name: 'name', type: 'string' }] };
const hash = hashStruct('Person', { name: 'Alice' }, types);
EIP712.hashType()
hashType: (primaryType, types) => HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
EIP712.HashType()
HashType: (deps) => (primaryType, types) => HashType
Factory: Hash type string according to EIP-712. Computes keccak256 of the encoded type string.
Parameters
deps
Crypto dependencies
keccak256
(data) => Uint8Array Keccak256 hash function
Returns
Function that hashes type string
(primaryType, types): HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If type is not found
Example
import { HashType } from './crypto/EIP712/hashType.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const types = { Mail: [{ name: 'contents', type: 'string' }] };
const typeHash = hashType('Mail', types);
EIP712.hashTypedData()
hashTypedData: (typedData) => HashType
Parameters
typedData
TypedData
Returns
HashType
EIP712.HashTypedData()
HashTypedData: (deps) => (typedData) => HashType
Factory: Hash typed data according to EIP-712 specification. Computes: keccak256(“\x19\x01” ‖ domainSeparator ‖ hashStruct(message))
Parameters
deps
Crypto dependencies
hashDomain
(domain) => HashType Hash domain function
hashStruct
(primaryType, data, types) => HashType Hash struct function
keccak256
(data) => Uint8Array Keccak256 hash function
Returns
Function that hashes typed data
(typedData): HashType
Parameters
typedData
TypedData
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If types are not found
Throws
If message data is invalid
Example
import { HashTypedData } from './crypto/EIP712/hashTypedData.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { Hash as HashDomain } from './Domain/hash.js';
import { HashStruct } from './hashStruct.js';
const hashDomain = HashDomain({ hashStruct });
const hashStruct = HashStruct({ keccak256, encodeData });
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const hash = hashTypedData(typedData);
EIP712.recoverAddress()
recoverAddress: (signature, typedData) => AddressType
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
EIP712.RecoverAddress()
RecoverAddress: (deps) => (signature, typedData) => AddressType
Factory: Recover Ethereum address from EIP-712 typed data signature. Uses ECDSA public key recovery to determine the signer’s address.
Parameters
deps
Crypto dependencies
hashTypedData
(typedData) => HashType Hash typed data function
keccak256
(data) => Uint8Array Keccak256 hash function
recoverPublicKey
(signature, hash, recoveryBit) => Uint8Array Secp256k1 public key recovery function
Returns
Function that recovers address
(signature, typedData): AddressType
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If signature recovery fails or public key format is invalid
Example
import { RecoverAddress } from './crypto/EIP712/recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
import { HashTypedData } from './hashTypedData.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const address = recoverAddress(signature, typedData);
EIP712.signTypedData()
signTypedData: (typedData, privateKey) => Signature
Parameters
typedData
any
privateKey
any
Returns
Signature
EIP712.SignTypedData()
SignTypedData: (deps) => (typedData, privateKey) => Signature
Factory: Sign EIP-712 typed data with ECDSA private key. Produces a signature that can be verified against the signer’s address.
Parameters
deps
Crypto dependencies
hashTypedData
(typedData) => HashType Hash typed data function
sign
(hash, privateKey) => Signature Secp256k1 sign function
Returns
Function that signs typed data
(typedData, privateKey): Signature
Parameters
typedData
TypedData
privateKey
Uint8Array
Returns
Signature
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If private key length is invalid or signing fails
Example
import { SignTypedData } from './crypto/EIP712/signTypedData.js';
import { HashTypedData } from './hashTypedData.js';
import { sign } from '../Secp256k1/sign.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const signTypedData = SignTypedData({ hashTypedData, sign });
const privateKey = new Uint8Array(32);
const signature = signTypedData(typedData, privateKey);
EIP712.validate()
validate: (typedData) => void
Validate typed data structure against EIP-712 specification. Checks domain, types, primaryType, and message structure.
Parameters
typedData
TypedData Typed data to validate
Returns
void
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If structure is invalid or missing required fields
Example
import * as EIP712 from './crypto/EIP712/index.js';
EIP712.validate(typedData); // Throws if invalid
EIP712.verifyTypedData()
verifyTypedData: (signature, typedData, address) => boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean
EIP712.VerifyTypedData()
VerifyTypedData: (deps) => (signature, typedData, address) => boolean
Factory: Verify EIP-712 typed data signature against expected signer address. Uses constant-time comparison to prevent timing attacks.
Parameters
deps
Crypto dependencies
recoverAddress
(signature, typedData) => AddressType Recover address function
Returns
Function that verifies signature
(signature, typedData, address): boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { VerifyTypedData } from './crypto/EIP712/verifyTypedData.js';
import { RecoverAddress } from './recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const verifyTypedData = VerifyTypedData({ recoverAddress });
const valid = verifyTypedData(signature, typedData, signerAddress);
Ether
Ether: EtherConstructor
Gwei
Gwei: GweiConstructor
Hash
Hash: HashConstructor
Hex
Hex: typeof Hex
Keccak256
Keccak256: (input) => Keccak256Hash & object = Keccak256JS
Type Declaration
contractAddress()
contractAddress: (sender, nonce) => Uint8Array<ArrayBufferLike>
Compute contract address from deployer and nonce Uses CREATE formula: keccak256(rlp([sender, nonce]))[12:]
Parameters
sender
Uint8Array<ArrayBufferLike> Deployer address (20 bytes)
nonce
bigint Transaction nonce
Returns
Uint8Array<ArrayBufferLike> Contract address (20 bytes)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If sender is not 20 bytes
Example
import * as Keccak256 from './crypto/Keccak256/index.js';
const sender = new Uint8Array(20);
const address = Keccak256.contractAddress(sender, 0n);
create2Address()
create2Address: (sender, salt, initCodeHash) => Uint8Array<ArrayBufferLike>
Compute CREATE2 address Uses CREATE2 formula: keccak256(0xff ++ sender ++ salt ++ keccak256(init_code))[12:]
Parameters
sender
Uint8Array<ArrayBufferLike> Deployer address (20 bytes)
salt
Uint8Array<ArrayBufferLike> 32-byte salt
initCodeHash
Uint8Array<ArrayBufferLike> Hash of initialization code
Returns
Uint8Array<ArrayBufferLike> Contract address (20 bytes)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If sender is not 20 bytes
Throws
If salt is not 32 bytes
Throws
If initCodeHash is not 32 bytes
Example
import * as Keccak256 from './crypto/Keccak256/index.js';
const sender = new Uint8Array(20);
const salt = new Uint8Array(32);
const initCodeHash = new Uint8Array(32);
const address = Keccak256.create2Address(sender, salt, initCodeHash);
DIGEST_SIZE
DIGEST_SIZE: number
Digest size in bytes (32 bytes = 256 bits)
Since
0.0.0
from()
from: (input) => Keccak256Hash
Hash input with Keccak-256 (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string starting with 0x: parse as hex
  • string: UTF-8 encode then hash
Parameters
input
Data to hash string | Uint8Array<ArrayBufferLike>
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto/keccak256 for crypto documentation
Since
0.0.0
Throws
If hex string is invalid
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';

const hash1 = Keccak256Hash.from("0x1234");      // Hex
const hash2 = Keccak256Hash.from("hello");       // String
const hash3 = Keccak256Hash.from(uint8array);    // Bytes
fromHex()
fromHex: (hex) => Keccak256Hash = hashHex
Hash hex string with Keccak-256
Parameters
hex
string Hex string to hash (with or without 0x prefix)
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If hex string is invalid or has odd length
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.fromHex('0x1234abcd');
fromString()
fromString: (str) => Keccak256Hash = hashString
Hash string with Keccak-256 String is UTF-8 encoded before hashing.
Parameters
str
string String to hash
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.fromString('hello');
fromTopic()
fromTopic: (signature) => Keccak256Hash = topic
Compute event topic (32-byte Keccak-256 hash) Used for Ethereum event signatures.
Parameters
signature
string Event signature string
Returns
Keccak256Hash 32-byte topic
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const topic = Keccak256Hash.fromTopic('Transfer(address,address,uint256)');
hash()
hash: (data) => Keccak256Hash
Hash data with Keccak-256
Parameters
data
Uint8Array<ArrayBufferLike> Data to hash
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.from(data);
hashHex()
hashHex: (hex) => Keccak256Hash
Hash hex string with Keccak-256
Parameters
hex
string Hex string to hash (with or without 0x prefix)
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If hex string is invalid or has odd length
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.fromHex('0x1234abcd');
hashMultiple()
hashMultiple: (chunks) => Keccak256Hash
Hash multiple data chunks in sequence Equivalent to hashing the concatenation of all chunks.
Parameters
chunks
readonly Uint8Array<ArrayBufferLike>[] Array of data chunks to hash
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.from(combined);
hashString()
hashString: (str) => Keccak256Hash
Hash string with Keccak-256 String is UTF-8 encoded before hashing.
Parameters
str
string String to hash
Returns
Keccak256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const hash = Keccak256Hash.fromString('hello');
RATE
RATE: number
Rate in bytes for Keccak256 (136 bytes = 1088 bits)
Since
0.0.0
selector()
selector: (signature) => Uint8Array<ArrayBufferLike>
Compute function selector (first 4 bytes of Keccak-256 hash) Used for Ethereum function signatures.
Parameters
signature
string Function signature string
Returns
Uint8Array<ArrayBufferLike> 4-byte selector
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Keccak256 from './crypto/Keccak256/index.js';
const selector = Keccak256.selector('transfer(address,uint256)');
// Uint8Array(4) [0xa9, 0x05, 0x9c, 0xbb]
STATE_SIZE
STATE_SIZE: number
State size (25 u64 words = 1600 bits)
Since
0.0.0
topic()
topic: (signature) => Keccak256Hash
Compute event topic (32-byte Keccak-256 hash) Used for Ethereum event signatures.
Parameters
signature
string Event signature string
Returns
Keccak256Hash 32-byte topic
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Keccak256Hash } from './crypto/Keccak256/index.js';
const topic = Keccak256Hash.fromTopic('Transfer(address,address,uint256)');
KZG
KZG: typeof KZG
ModExp
ModExp: (base, exp, modulus) => bigint & object
ModExp - Modular Exponentiation Computes base^exp mod modulus for arbitrary-precision integers. Used by MODEXP precompile (0x05) per EIP-198/EIP-2565.
Type Declaration
calculateGas()
calculateGas: (baseLen, expLen, modLen, expHead) => bigint
Calculate gas cost for MODEXP operation per EIP-2565 Gas formula: max(200, floor(mult_complexity * iteration_count / 3))
Parameters
baseLen
bigint Length of base in bytes
expLen
bigint Length of exponent in bytes
modLen
bigint Length of modulus in bytes
expHead
bigint First 32 bytes of exponent as BigInt (for leading zeros calc)
Returns
bigint Gas cost
See
https://eips.ethereum.org/EIPS/eip-2565
Since
0.0.0
Example
import { ModExp } from './crypto/ModExp/index.js';

// Calculate gas for 2^3 mod 5
const gas = ModExp.calculateGas(1n, 1n, 1n, 3n);
console.log(gas); // 200n (minimum)
modexp()
modexp: (base, exp, modulus) => bigint
Modular exponentiation: base^exp mod modulus Computes arbitrary-precision modular exponentiation using native BigInt. Used by MODEXP precompile (0x05) per EIP-198. WARNING: This implementation is for general use. For cryptographic applications, consider timing attack resistance.
Parameters
base
bigint Base value
exp
bigint Exponent value
modulus
bigint Modulus value (must be > 0)
Returns
bigint Result of base^exp mod modulus
See
https://eips.ethereum.org/EIPS/eip-198
Since
0.0.0
Throws
If modulus is zero
Example
import { ModExp } from './crypto/ModExp/index.js';

// Compute 2^10 mod 1000 = 24
const result = ModExp.modexp(2n, 10n, 1000n);
console.log(result); // 24n

// RSA verification: signature^e mod n
const verified = ModExp.modexp(signature, e, n);
modexpBytes()
modexpBytes: (baseBytes, expBytes, modBytes) => Uint8Array<ArrayBufferLike>
Modular exponentiation with byte array inputs/outputs Computes base^exp mod modulus where inputs are big-endian byte arrays. Output is padded to modulus length per EIP-198 spec.
Parameters
baseBytes
Uint8Array<ArrayBufferLike> Base as big-endian bytes
expBytes
Uint8Array<ArrayBufferLike> Exponent as big-endian bytes
modBytes
Uint8Array<ArrayBufferLike> Modulus as big-endian bytes
Returns
Uint8Array<ArrayBufferLike> Result as big-endian bytes, padded to modulus length
See
https://eips.ethereum.org/EIPS/eip-198
Since
0.0.0
Throws
If modulus is zero
Example
import { ModExp } from './crypto/ModExp/index.js';

const base = new Uint8Array([0x02]); // 2
const exp = new Uint8Array([0x03]);  // 3
const mod = new Uint8Array([0x05]);  // 5

const result = ModExp.modexpBytes(base, exp, mod);
console.log(result); // Uint8Array([0x03]) = 3
See
Since
0.0.0
Example
import { ModExp } from './crypto/ModExp/index.js';

// Using BigInt directly
const result = ModExp.modexp(2n, 10n, 1000n); // 24n

// Using byte arrays (EIP-198 format)
const base = new Uint8Array([0x02]);
const exp = new Uint8Array([0x0a]);
const mod = new Uint8Array([0x03, 0xe8]);
const resultBytes = ModExp.modexpBytes(base, exp, mod);

// Calculate gas cost
const gas = ModExp.calculateGas(1n, 1n, 2n, 10n);
Opcode
Opcode: typeof Opcode
P256
P256: P256Constructor
P256 namespace with cryptographic operations
Ripemd160
Ripemd160: (input) => Ripemd160Hash & object
Type Declaration
from()
from: (input) => Ripemd160Hash
Hash input with RIPEMD160 (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string: UTF-8 encode then hash
Parameters
input
Data to hash string | Uint8Array<ArrayBufferLike>
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto/ripemd160 for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160Hash } from './crypto/Ripemd160/index.js';

const hash1 = Ripemd160Hash.from("hello");           // String
const hash2 = Ripemd160Hash.from(uint8array);        // Bytes
fromHex()
fromHex: (hex) => Ripemd160Hash = hashHex
Compute RIPEMD160 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashHex("0xdeadbeef");
console.log(hash.length); // 20
fromString()
fromString: (str) => Ripemd160Hash = hashString
Compute RIPEMD160 hash of UTF-8 string
Parameters
str
string Input string
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashString("hello");
console.log(hash.length); // 20
hash()
hash: (data) => Ripemd160Hash
Compute RIPEMD160 hash (20 bytes)
Parameters
data
Input data (Uint8Array or string) string | Uint8Array<ArrayBufferLike>
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hash(new Uint8Array([1, 2, 3]));
console.log(hash.length); // 20
hashHex()
hashHex: (hex) => Ripemd160Hash
Compute RIPEMD160 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashHex("0xdeadbeef");
console.log(hash.length); // 20
hashString()
hashString: (str) => Ripemd160Hash
Compute RIPEMD160 hash of UTF-8 string
Parameters
str
string Input string
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashString("hello");
console.log(hash.length); // 20
HEX_SIZE
HEX_SIZE: number
Size of RIPEMD160 hash in hex characters (without 0x prefix)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { HEX_SIZE } from './crypto/Ripemd160/index.js';
console.log(HEX_SIZE); // 40
SIZE
SIZE: number
Size of RIPEMD160 hash in bytes (160 bits)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SIZE } from './crypto/Ripemd160/index.js';
console.log(SIZE); // 20
Deprecated
Use Ripemd160Hash instead Ripemd160 alias maintained for backward compatibility
Rlp
Rlp: typeof Rlp
Secp256k1
Secp256k1: object
secp256k1/ECDSA Cryptography namespace Complete ECDSA signing and verification using the secp256k1 elliptic curve. All operations use the audited @noble/curves library for security. Full Ethereum compatibility with v = 27/28 recovery IDs.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Secp256k1 } from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';

// Sign a message hash
const messageHash = Hash.keccak256String('Hello, Ethereum!');
const privateKey = new Uint8Array(32);
const signature = Secp256k1.sign(messageHash, privateKey);

// Verify signature
const publicKey = Secp256k1.derivePublicKey(privateKey);
const valid = Secp256k1.verify(signature, messageHash, publicKey);

// Recover public key from signature
const recovered = Secp256k1.recoverPublicKey(signature, messageHash);

// Hash-level API for interop with other libraries
const hash = Hash.keccak256String('Hello');
const hashSig = Secp256k1.signHash(hash, privateKey);
const hashValid = Secp256k1.verifyHash(hashSig, hash, publicKey);
Secp256k1.addPoints()
addPoints: (pubKey1, pubKey2) => Secp256k1PublicKeyType
Add two secp256k1 public key points Performs elliptic curve point addition: P1 + P2. Used in ERC-5564 stealth address generation.
Parameters
pubKey1
Secp256k1PublicKeyType First 64-byte uncompressed public key
pubKey2
Secp256k1PublicKeyType Second 64-byte uncompressed public key
Returns
Secp256k1PublicKeyType Result 64-byte uncompressed public key
See
Since
0.0.0
Throws
If either public key is invalid
Throws
If point addition fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const pubKey1 = Secp256k1.derivePublicKey(privateKey1);
const pubKey2 = Secp256k1.derivePublicKey(privateKey2);
const sum = Secp256k1.addPoints(pubKey1, pubKey2);
console.log(sum.length); // 64
Secp256k1.createKeyPair()
createKeyPair: () => object
Generate a new secp256k1 key pair
Returns
object Key pair with 32-byte private key and 65-byte uncompressed public key
privateKey
privateKey: Uint8Array
publicKey
publicKey: Uint8Array
Example
import { Secp256k1 } from './crypto/Secp256k1/index.js';
const { privateKey, publicKey } = Secp256k1.createKeyPair();
Secp256k1.CURVE_ORDER
CURVE_ORDER: bigint
secp256k1 curve order (number of points on the curve)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { CURVE_ORDER } from './crypto/Secp256k1/index.js';
console.log(CURVE_ORDER); // 0xffffffffffff...
Secp256k1.derivePublicKey()
derivePublicKey: (privateKey) => Secp256k1PublicKeyType
Derive public key from private key Computes the public key point from a private key using scalar multiplication on the secp256k1 curve.
Parameters
privateKey
PrivateKeyType 32-byte private key
Returns
Secp256k1PublicKeyType 64-byte uncompressed public key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If private key is invalid
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as PrivateKey from './primitives/PrivateKey/index.js';
const privateKey = PrivateKey.from(new Uint8Array(32));
const publicKey = Secp256k1.derivePublicKey(privateKey);
console.log(publicKey.length); // 64
Secp256k1.ecdh()
ecdh: (privateKey, publicKey) => Uint8Array<ArrayBufferLike>
Perform ECDH key exchange Computes shared secret from your private key and their public key. Returns the x-coordinate of the shared point (32 bytes).
Parameters
privateKey
PrivateKeyType Your 32-byte private key
publicKey
Secp256k1PublicKeyType Their 64-byte uncompressed public key
Returns
Uint8Array<ArrayBufferLike> 32-byte shared secret (x-coordinate)
See
Since
0.0.0
Throws
If private key is invalid
Throws
If public key is invalid
Throws
If ECDH computation fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const myPrivateKey = new Uint8Array(32);
const theirPublicKey = Secp256k1.derivePublicKey(theirPrivateKey);
const sharedSecret = Secp256k1.ecdh(myPrivateKey, theirPublicKey);
console.log(sharedSecret.length); // 32
Secp256k1.getSharedSecret()
getSharedSecret: (privateKey, publicKey) => Uint8Array<ArrayBufferLike> = ecdh
Perform ECDH key exchange Computes shared secret from your private key and their public key. Returns the x-coordinate of the shared point (32 bytes).
Parameters
privateKey
PrivateKeyType Your 32-byte private key
publicKey
Secp256k1PublicKeyType Their 64-byte uncompressed public key
Returns
Uint8Array<ArrayBufferLike> 32-byte shared secret (x-coordinate)
See
Since
0.0.0
Throws
If private key is invalid
Throws
If public key is invalid
Throws
If ECDH computation fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const myPrivateKey = new Uint8Array(32);
const theirPublicKey = Secp256k1.derivePublicKey(theirPrivateKey);
const sharedSecret = Secp256k1.ecdh(myPrivateKey, theirPublicKey);
console.log(sharedSecret.length); // 32
Secp256k1.isValidPrivateKey()
isValidPrivateKey: (privateKey) => boolean
Validate private key Checks that the private key is within valid range [1, n-1] where n is the curve order.
Parameters
privateKey
Uint8Array<ArrayBufferLike> 32-byte private key
Returns
boolean true if private key is valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const privateKey = new Uint8Array(32);
const valid = Secp256k1.isValidPrivateKey(privateKey);
Secp256k1.isValidPublicKey()
isValidPublicKey: (publicKey) => publicKey is Secp256k1PublicKeyType
Validate public key Checks that the public key is a valid point on the secp256k1 curve.
Parameters
publicKey
Uint8Array<ArrayBufferLike> 64-byte uncompressed public key
Returns
publicKey is Secp256k1PublicKeyType true if public key is valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const publicKey = new Uint8Array(64);
if (Secp256k1.isValidPublicKey(publicKey)) {
  const branded = publicKey; // now Secp256k1PublicKeyType
}
Secp256k1.isValidSignature()
isValidSignature: (signature) => boolean
Validate signature components Checks that r and s are within valid range [1, n-1] where n is the curve order. Also enforces low-s values to prevent malleability.
Parameters
signature
Secp256k1SignatureType ECDSA signature to validate (r and s are HashType)
Returns
boolean true if signature is valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';
const signature = { r: Hash.from(new Uint8Array(32)), s: Hash.from(new Uint8Array(32)), v: 27 };
const valid = Secp256k1.isValidSignature(signature);
Secp256k1.PRIVATE_KEY_SIZE
PRIVATE_KEY_SIZE: number
Private key size in bytes
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { PRIVATE_KEY_SIZE } from './crypto/Secp256k1/index.js';
console.log(PRIVATE_KEY_SIZE); // 32
Secp256k1.PrivateKey
PrivateKey: __module = PrivateKeyMethods
Secp256k1.PUBLIC_KEY_SIZE
PUBLIC_KEY_SIZE: number
Uncompressed public key size in bytes (64 bytes, no prefix)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { PUBLIC_KEY_SIZE } from './crypto/Secp256k1/index.js';
console.log(PUBLIC_KEY_SIZE); // 64
Secp256k1.PublicKey
PublicKey: __module = PublicKeyMethods
Secp256k1.randomPrivateKey()
randomPrivateKey: () => Uint8Array<ArrayBufferLike>
Generate a cryptographically secure random secp256k1 private key
Returns
Uint8Array<ArrayBufferLike> 32-byte private key
Example
import { Secp256k1 } from './crypto/Secp256k1/index.js';
const privateKey = Secp256k1.randomPrivateKey();
const publicKey = Secp256k1.derivePublicKey(privateKey);
Secp256k1.recoverPublicKey()
recoverPublicKey: (signature, messageHash) => Secp256k1PublicKeyType
Recover public key from signature and message hash Uses the recovery id (v) to recover the exact public key that created the signature. This is what enables Ethereum’s address recovery from transaction signatures.
Parameters
signature
ECDSA signature components
r
Uint8Array<ArrayBufferLike> 32-byte signature component r
s
Uint8Array<ArrayBufferLike> 32-byte signature component s
v
number Recovery id (27/28 or 0/1)
messageHash
HashType 32-byte message hash that was signed
Returns
Secp256k1PublicKeyType 64-byte uncompressed public key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If signature or recovery fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';
const messageHash = Hash.keccak256String('Hello');
const recovered = Secp256k1.recoverPublicKey(
  { r: rBytes, s: sBytes, v: 27 },
  messageHash
);
Secp256k1.recoverPublicKeyFromHash()
recoverPublicKeyFromHash: (signature, hash) => Secp256k1PublicKeyType
Recover public key from signature and pre-hashed message This is the hash-level API that operates directly on a 32-byte hash. Use this when you need custom hashing schemes or interop with other libraries. For standard Ethereum signing, use recoverPublicKey() instead. Uses the recovery id (v) to recover the exact public key that created the signature. This is what enables Ethereum’s address recovery from transaction signatures.
Parameters
signature
ECDSA signature components
r
Uint8Array<ArrayBufferLike> 32-byte signature component r
s
Uint8Array<ArrayBufferLike> 32-byte signature component s
v
number Recovery id (27/28 or 0/1)
hash
HashType 32-byte hash that was signed (pre-hashed message)
Returns
Secp256k1PublicKeyType 64-byte uncompressed public key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If signature or recovery fails
Throws
If hash is not 32 bytes
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';

// Recover public key from a pre-hashed message (hash-level API)
const hash = Hash.keccak256String('Hello');
const recovered = Secp256k1.recoverPublicKeyFromHash(
  { r: rBytes, s: sBytes, v: 27 },
  hash
);

// For comparison, recoverPublicKey() hashes internally (message-level API)
const recovered2 = Secp256k1.recoverPublicKey(
  { r: rBytes, s: sBytes, v: 27 },
  messageHash
);
Secp256k1.scalarMultiply()
scalarMultiply: (scalar) => Secp256k1PublicKeyType
Multiply generator point by scalar Performs scalar multiplication: scalar * G (generator point). Used in ERC-5564 stealth address generation.
Parameters
scalar
Uint8Array<ArrayBufferLike> 32-byte scalar value
Returns
Secp256k1PublicKeyType Result 64-byte uncompressed public key
See
Since
0.0.0
Throws
If scalar multiplication fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
const scalar = new Uint8Array(32);
scalar[31] = 5; // scalar = 5
const result = Secp256k1.scalarMultiply(scalar);
console.log(result.length); // 64
Secp256k1.sign()
sign: (messageHash, privateKey) => Secp256k1SignatureType
Sign a message hash with a private key Uses deterministic ECDSA (RFC 6979) for signature generation. Returns signature with Ethereum-compatible v value (27 or 28).
Parameters
messageHash
HashType 32-byte message hash to sign
privateKey
PrivateKeyType 32-byte private key
Returns
Secp256k1SignatureType ECDSA signature with r, s, v components
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If private key is invalid
Throws
If signing fails
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';
import * as PrivateKey from './primitives/PrivateKey/index.js';
const messageHash = Hash.keccak256String('Hello!');
const privateKey = PrivateKey.from(new Uint8Array(32));
const signature = Secp256k1.sign(messageHash, privateKey);
Secp256k1.Signature
Signature: __module = SignatureMethods
Secp256k1.SIGNATURE_COMPONENT_SIZE
SIGNATURE_COMPONENT_SIZE: number
Signature component size in bytes (r and s are each 32 bytes)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SIGNATURE_COMPONENT_SIZE } from './crypto/Secp256k1/index.js';
console.log(SIGNATURE_COMPONENT_SIZE); // 32
Secp256k1.signHash()
signHash: (hash, privateKey) => Secp256k1SignatureType
Sign a pre-hashed message with a private key This is the hash-level API that operates directly on a 32-byte hash. Use this when you need custom hashing schemes or interop with other libraries. For standard Ethereum signing, use sign() instead. Uses deterministic ECDSA (RFC 6979) for signature generation. Returns signature with Ethereum-compatible v value (27 or 28).
Parameters
hash
HashType 32-byte hash to sign (pre-hashed message)
privateKey
PrivateKeyType 32-byte private key
Returns
Secp256k1SignatureType ECDSA signature with r, s, v components
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If private key is invalid
Throws
If signing fails or hash is not 32 bytes
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';
import * as PrivateKey from './primitives/PrivateKey/index.js';

// Sign a pre-hashed message (hash-level API)
const hash = Hash.keccak256String('Hello!');
const privateKey = PrivateKey.from(new Uint8Array(32));
const signature = Secp256k1.signHash(hash, privateKey);

// For comparison, sign() hashes internally (message-level API)
const signature2 = Secp256k1.sign(Hash.keccak256String('Hello!'), privateKey);
Secp256k1.verify()
verify: (signature, messageHash, publicKey) => boolean
Verify an ECDSA signature
Parameters
signature
Secp256k1SignatureType ECDSA signature with r, s, v components (r and s are HashType)
messageHash
HashType 32-byte message hash that was signed
publicKey
Secp256k1PublicKeyType 64-byte uncompressed public key
Returns
boolean true if signature is valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If signature v is invalid
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';
const r = Hash.from(rBytes);
const s = Hash.from(sBytes);
const valid = Secp256k1.verify({ r, s, v: 27 }, messageHash, publicKey);
Secp256k1.verifyHash()
verifyHash: (signature, hash, publicKey) => boolean
Verify an ECDSA signature against a pre-hashed message This is the hash-level API that operates directly on a 32-byte hash. Use this when you need custom hashing schemes or interop with other libraries. For standard Ethereum signing, use verify() instead.
Parameters
signature
Secp256k1SignatureType ECDSA signature with r, s, v components (r and s are HashType)
hash
HashType 32-byte hash that was signed (pre-hashed message)
publicKey
Secp256k1PublicKeyType 64-byte uncompressed public key
Returns
boolean true if signature is valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If hash is not 32 bytes
Example
import * as Secp256k1 from './crypto/Secp256k1/index.js';
import * as Hash from './primitives/Hash/index.js';

// Verify a signature against a pre-hashed message (hash-level API)
const hash = Hash.keccak256String('Hello!');
const valid = Secp256k1.verifyHash({ r, s, v: 27 }, hash, publicKey);

// For comparison, verify() hashes internally (message-level API)
const valid2 = Secp256k1.verify({ r, s, v: 27 }, messageHash, publicKey);
SHA256
SHA256: (input) => SHA256Hash & object
Type Declaration
BLOCK_SIZE
BLOCK_SIZE: number
SHA256 block size in bytes
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { BLOCK_SIZE } from './crypto/SHA256/index.js';
console.log(BLOCK_SIZE); // 64
create()
create: () => object
Incremental hasher for streaming data
Returns
object Hasher instance
digest()
digest: () => Uint8Array
Returns
Uint8Array
update()
update: (data) => void
Parameters
data
Uint8Array
Returns
void
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hasher = SHA256.create();
hasher.update(new Uint8Array([1, 2, 3]));
hasher.update(new Uint8Array([4, 5, 6]));
const hash = hasher.digest();
from()
from: (input) => SHA256Hash
Hash input with SHA256 (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string starting with 0x: parse as hex
  • string: UTF-8 encode then hash
Parameters
input
Data to hash string | Uint8Array<ArrayBufferLike>
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto/sha256 for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256Hash } from './crypto/SHA256/index.js';

const hash1 = SHA256Hash.from("0x1234");      // Hex
const hash2 = SHA256Hash.from("hello");       // String
const hash3 = SHA256Hash.from(uint8array);    // Bytes
fromHex()
fromHex: (hex) => SHA256Hash = hashHex
Compute SHA256 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hash = SHA256.hashHex("0xdeadbeef");
console.log(hash.length); // 32
fromString()
fromString: (str) => SHA256Hash = hashString
Compute SHA256 hash of UTF-8 string
Parameters
str
string Input string
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hash = SHA256.hashString("hello world");
console.log(hash.length); // 32
hash()
hash: (data) => SHA256Hash
Compute SHA256 hash of input data
Parameters
data
Uint8Array<ArrayBufferLike> Input data as Uint8Array
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256Hash } from './crypto/SHA256/index.js';
const hash = SHA256Hash.from(new Uint8Array([1, 2, 3]));
console.log(hash.length); // 32
hashHex()
hashHex: (hex) => SHA256Hash
Compute SHA256 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hash = SHA256.hashHex("0xdeadbeef");
console.log(hash.length); // 32
hashString()
hashString: (str) => SHA256Hash
Compute SHA256 hash of UTF-8 string
Parameters
str
string Input string
Returns
SHA256Hash 32-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hash = SHA256.hashString("hello world");
console.log(hash.length); // 32
OUTPUT_SIZE
OUTPUT_SIZE: number
SHA256 output size in bytes (256 bits / 8)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { OUTPUT_SIZE } from './crypto/SHA256/index.js';
console.log(OUTPUT_SIZE); // 32
toHex()
toHex: (hash) => string
Convert hash output to hex string
Parameters
hash
Uint8Array<ArrayBufferLike> Hash bytes
Returns
string Hex string with 0x prefix
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHA256 } from './crypto/SHA256/index.js';
const hash = SHA256.hash(new Uint8Array([1, 2, 3]));
const hexStr = SHA256.toHex(hash);
console.log(hexStr); // "0x..."
Deprecated
Use SHA256Hash instead SHA256 alias maintained for backward compatibility
Siwe
Siwe: typeof Siwe
StorageKey
StorageKey: object
StorageKey.create()
create: (address, slot) => StorageKeyType
Parameters
address
AddressType
slot
bigint
Returns
StorageKeyType
StorageKey.equals()
equals: (a, b) => boolean
Parameters
a
StorageKeyLike
b
StorageKeyLike
Returns
boolean
StorageKey.from()
from: (value) => StorageKeyType
Parameters
value
StorageKeyLike
Returns
StorageKeyType
StorageKey.fromString()
fromString: (str) => StorageKeyType | undefined
Parameters
str
string
Returns
StorageKeyType | undefined
StorageKey.hashCode()
hashCode: (key) => number
Parameters
key
StorageKeyLike
Returns
number
StorageKey.is()
is: (value) => value is StorageKeyType
Parameters
value
unknown
Returns
value is StorageKeyType
StorageKey.toString()
toString: (key) => string
Parameters
key
StorageKeyLike
Returns
string
Uint
Uint: typeof Uint
Wei
Wei: WeiConstructor
X25519
X25519: object
X25519 Elliptic Curve Diffie-Hellman Curve25519 key exchange algorithm for secure shared secret generation. Fast, simple, and designed for ECDH key agreement. Used in modern protocols like TLS 1.3, WireGuard, Signal, and SSH.
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { X25519 } from './crypto/X25519/index.js';

// Generate two keypairs
const seed1 = crypto.getRandomValues(new Uint8Array(32));
const seed2 = crypto.getRandomValues(new Uint8Array(32));
const keypair1 = X25519.keypairFromSeed(seed1);
const keypair2 = X25519.keypairFromSeed(seed2);

// Perform key exchange
const shared1 = X25519.scalarmult(keypair1.secretKey, keypair2.publicKey);
const shared2 = X25519.scalarmult(keypair2.secretKey, keypair1.publicKey);
// shared1 === shared2 (same shared secret from both sides)
X25519.derivePublicKey()
derivePublicKey: (secretKey) => PublicKey
Derive public key from secret key
Parameters
secretKey
SecretKey 32-byte secret key
Returns
PublicKey 32-byte public key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If secret key is invalid
Example
import { X25519 } from './crypto/X25519/index.js';
const secretKey = crypto.getRandomValues(new Uint8Array(32));
const publicKey = X25519.derivePublicKey(secretKey);
console.log(publicKey.length); // 32
X25519.generateKeypair()
generateKeypair: () => object
Generate random keypair Uses crypto.getRandomValues for secure random generation
Returns
object Object with secretKey and publicKey
publicKey
publicKey: PublicKey
secretKey
secretKey: SecretKey
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { X25519 } from './crypto/X25519/index.js';
const keypair = X25519.generateKeypair();
console.log(keypair.secretKey.length); // 32
console.log(keypair.publicKey.length); // 32
X25519.generateSecretKey()
generateSecretKey: () => SecretKey
Generate random secret key Uses crypto.getRandomValues for secure random generation
Returns
SecretKey 32-byte random secret key
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { X25519 } from './crypto/X25519/index.js';
const secretKey = X25519.generateSecretKey();
const publicKey = X25519.derivePublicKey(secretKey);
console.log(secretKey.length); // 32
X25519.keypairFromSeed()
keypairFromSeed: (seed) => object
Generate X25519 keypair from seed
Parameters
seed
Uint8Array<ArrayBufferLike> 32-byte seed for deterministic generation
Returns
object Object with secretKey and publicKey
publicKey
publicKey: PublicKey
secretKey
secretKey: SecretKey
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If seed length is invalid
Example
import { X25519 } from './crypto/X25519/index.js';
const seed = crypto.getRandomValues(new Uint8Array(32));
const keypair = X25519.keypairFromSeed(seed);
console.log(keypair.secretKey.length); // 32
console.log(keypair.publicKey.length); // 32
X25519.PUBLIC_KEY_SIZE
PUBLIC_KEY_SIZE: 32
Public key size in bytes
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { PUBLIC_KEY_SIZE } from './crypto/X25519/index.js';
console.log(PUBLIC_KEY_SIZE); // 32
X25519.scalarmult()
scalarmult: (secretKey, publicKey) => SharedSecret
Perform X25519 scalar multiplication (ECDH) Computes shared secret from your secret key and their public key.
Parameters
secretKey
SecretKey Your 32-byte secret key
publicKey
PublicKey Their 32-byte public key
Returns
SharedSecret 32-byte shared secret
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
If secret key is invalid
Throws
If public key is invalid
Throws
If scalar multiplication fails
Example
import { X25519 } from './crypto/X25519/index.js';
const mySecret = crypto.getRandomValues(new Uint8Array(32));
const theirPublic = X25519.derivePublicKey(theirSecret);
const shared = X25519.scalarmult(mySecret, theirPublic);
console.log(shared.length); // 32
X25519.SECRET_KEY_SIZE
SECRET_KEY_SIZE: 32
Secret key size in bytes
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SECRET_KEY_SIZE } from './crypto/X25519/index.js';
console.log(SECRET_KEY_SIZE); // 32
X25519.SHARED_SECRET_SIZE
SHARED_SECRET_SIZE: 32
Shared secret size in bytes
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SHARED_SECRET_SIZE } from './crypto/X25519/index.js';
console.log(SHARED_SECRET_SIZE); // 32
X25519.validatePublicKey()
validatePublicKey: (publicKey) => boolean
Validate a public key Checks if the public key has correct length
Parameters
publicKey
PublicKey Public key to validate
Returns
boolean True if valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { X25519 } from './crypto/X25519/index.js';
const publicKey = new Uint8Array(32);
const valid = X25519.validatePublicKey(publicKey);
X25519.validateSecretKey()
validateSecretKey: (secretKey) => boolean
Validate a secret key Checks if the secret key has correct length and can derive a public key
Parameters
secretKey
SecretKey Secret key to validate
Returns
boolean True if valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { X25519 } from './crypto/X25519/index.js';
const secretKey = new Uint8Array(32);
const valid = X25519.validateSecretKey(secretKey);

Functions

allocateOutput()

allocateOutput(size): Uint8Array
Defined in: src/native-loader/index.ts:64 Helper to allocate buffer for output

Parameters

size
number

Returns

Uint8Array

allocateStringOutput()

allocateStringOutput(size): object
Defined in: src/native-loader/index.ts:71 Helper to allocate buffer for string output

Parameters

size
number

Returns

object
buffer
buffer: Uint8Array
ptr
ptr: Uint8Array

checkError()

checkError(code, operation): void
Defined in: src/native-loader/index.ts:53 Check error code and throw if non-zero

Parameters

code
number
operation
string

Returns

void

getNativeErrorMessage()

getNativeErrorMessage(code): string
Defined in: src/native-loader/types.ts:224 Convert native error code to error message

Parameters

code
number

Returns

string

getNativeExtension()

getNativeExtension(): string
Defined in: src/native-loader/platform.ts:45 Get file extension for native libraries on current platform

Returns

string

getPlatform()

getPlatform(): Platform
Defined in: src/native-loader/platform.ts:15 Get current platform identifier

Returns

Platform

isBun()

isBun(): boolean
Defined in: src/native-loader/index.ts:19 Runtime environment detection

Returns

boolean

isNativeSupported()

isNativeSupported(): boolean
Defined in: src/native-loader/platform.ts:63 Check if native bindings are supported on current platform

Returns

boolean

isNode()

isNode(): boolean
Defined in: src/native-loader/index.ts:23

Returns

boolean

loadNative()

loadNative(): Promise<NativeModule | ConvertFns<{ primitives_abi_compute_selector: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_address_equals: { args: readonly [ptr, ptr]; returns: bool; }; primitives_address_from_hex: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_address_is_zero: { args: readonly [ptr]; returns: bool; }; primitives_address_to_checksum_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_address_to_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_blake2b: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_bytes_to_hex: { args: readonly [ptr, uint64_t, ptr, ptr]; returns: int32_t; }; primitives_hash_equals: { args: readonly [ptr, ptr]; returns: bool; }; primitives_hash_from_hex: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_hash_to_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_hex_to_bytes: { args: readonly [cstring, ptr, ptr]; returns: int32_t; }; primitives_keccak256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_ripemd160: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_secp256k1_recover_address: { args: readonly [ptr, int32_t, ptr, ptr]; returns: int32_t; }; primitives_sha256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_solidity_keccak256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_solidity_sha256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; secp256k1DerivePublicKey: { args: readonly [ptr, ptr]; returns: int32_t; }; secp256k1Sign: { args: readonly [ptr, ptr, ptr]; returns: int32_t; }; secp256k1Verify: { args: readonly [ptr, ptr, ptr]; returns: bool; }; }>>
Defined in: src/native-loader/index.ts:34 Load native library using appropriate loader

Returns

Promise<NativeModule | ConvertFns<{ primitives_abi_compute_selector: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_address_equals: { args: readonly [ptr, ptr]; returns: bool; }; primitives_address_from_hex: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_address_is_zero: { args: readonly [ptr]; returns: bool; }; primitives_address_to_checksum_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_address_to_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_blake2b: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_bytes_to_hex: { args: readonly [ptr, uint64_t, ptr, ptr]; returns: int32_t; }; primitives_hash_equals: { args: readonly [ptr, ptr]; returns: bool; }; primitives_hash_from_hex: { args: readonly [cstring, ptr]; returns: int32_t; }; primitives_hash_to_hex: { args: readonly [ptr, ptr]; returns: int32_t; }; primitives_hex_to_bytes: { args: readonly [cstring, ptr, ptr]; returns: int32_t; }; primitives_keccak256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_ripemd160: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_secp256k1_recover_address: { args: readonly [ptr, int32_t, ptr, ptr]; returns: int32_t; }; primitives_sha256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_solidity_keccak256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; primitives_solidity_sha256: { args: readonly [ptr, uint64_t, ptr]; returns: int32_t; }; secp256k1DerivePublicKey: { args: readonly [ptr, ptr]; returns: int32_t; }; secp256k1Sign: { args: readonly [ptr, ptr, ptr]; returns: int32_t; }; secp256k1Verify: { args: readonly [ptr, ptr, ptr]; returns: bool; }; }>>

References

Abi

Re-exports Abi

AbstractError

Re-exports AbstractError

AccessList

Re-exports AccessList

Address

Re-exports Address

AesGcm

Re-exports AesGcm

Authorization

Renames and re-exports primitives/Authorization

Base64

Renames and re-exports primitives/Base64

BeaconBlockRoot

Renames and re-exports primitives/BeaconBlockRoot

BinaryTree

Renames and re-exports primitives/BinaryTree

Bip39

Re-exports Bip39

Blake2

Re-exports Blake2

Blake2Hash

Re-exports Blake2Hash

Blake2HashType

Renames and re-exports Blake2Hash

Blob

Re-exports Blob

Block

Renames and re-exports primitives/Block

BlockBody

Renames and re-exports primitives/BlockBody

BlockFilter

Renames and re-exports primitives/BlockFilter

BlockHash

Renames and re-exports primitives/BlockHash

BlockHeader

Renames and re-exports primitives/BlockHeader

BlockNumber

Renames and re-exports primitives/BlockNumber

BloomFilter

Re-exports BloomFilter

Bls12381

Re-exports Bls12381

Bls12381Fp2Type

Re-exports Bls12381Fp2Type

Bls12381G1PointType

Re-exports Bls12381G1PointType

Bls12381G2PointType

Re-exports Bls12381G2PointType

BN254

Re-exports BN254

BrandedAbi

Renames and re-exports primitives/Abi

BrandedAccessList

Renames and re-exports primitives/AccessList

BrandedAddress

Re-exports BrandedAddress

BrandedAuthorization

Renames and re-exports primitives/Authorization

BrandedBase64

Re-exports BrandedBase64

BrandedBinaryTree

Renames and re-exports primitives/BinaryTree

BrandedBlob

Renames and re-exports primitives/Blob

BrandedBloomFilter

Renames and re-exports primitives/BloomFilter

BrandedBytecode

Renames and re-exports primitives/Bytecode

BrandedBytes

Re-exports BrandedBytes

BrandedBytes1

Re-exports BrandedBytes1

BrandedBytes16

Re-exports BrandedBytes16

BrandedBytes2

Re-exports BrandedBytes2

BrandedBytes3

Re-exports BrandedBytes3

BrandedBytes32

Re-exports BrandedBytes32

BrandedBytes4

Re-exports BrandedBytes4

BrandedBytes5

Re-exports BrandedBytes5

BrandedBytes6

Re-exports BrandedBytes6

BrandedBytes64

Re-exports BrandedBytes64

BrandedBytes7

Re-exports BrandedBytes7

BrandedBytes8

Re-exports BrandedBytes8

BrandedChain

Re-exports BrandedChain

BrandedEther

Re-exports BrandedEther

BrandedEventLog

Renames and re-exports primitives/EventLog

BrandedFeeMarket

Re-exports BrandedFeeMarket

BrandedGwei

Re-exports BrandedGwei

BrandedHash

Renames and re-exports primitives/Hash

BrandedHex

Re-exports BrandedHex

BrandedInt128

Renames and re-exports primitives/Int128

BrandedInt16

Renames and re-exports primitives/Int16

BrandedInt256

Renames and re-exports primitives/Int256

BrandedInt32

Renames and re-exports primitives/Int32

BrandedInt64

Renames and re-exports primitives/Int64

BrandedInt8

Renames and re-exports primitives/Int8

BrandedOpcode

Re-exports BrandedOpcode

BrandedRlp

Re-exports BrandedRlp

BrandedSiwe

Renames and re-exports primitives/Siwe

BrandedStorageKey

Renames and re-exports primitives/State

BrandedUint

Renames and re-exports primitives/Uint

BrandedUint128

Renames and re-exports primitives/Uint128

BrandedUint16

Renames and re-exports primitives/Uint16

BrandedUint32

Renames and re-exports primitives/Uint32

BrandedUint64

Renames and re-exports primitives/Uint64

BrandedUint8

Renames and re-exports primitives/Uint8

BrandedWei

Re-exports BrandedWei

Bytecode

Re-exports Bytecode

Bytes

Re-exports Bytes

Bytes1

Re-exports Bytes1

Bytes16

Re-exports Bytes16

Bytes2

Re-exports Bytes2

Bytes3

Re-exports Bytes3

Bytes32

Re-exports Bytes32

Bytes4

Re-exports Bytes4

Bytes5

Re-exports Bytes5

Bytes6

Re-exports Bytes6

Bytes64

Re-exports Bytes64

Bytes7

Re-exports Bytes7

Bytes8

Re-exports Bytes8

CallTrace

Renames and re-exports primitives/CallTrace

ChaCha20Poly1305

Re-exports ChaCha20Poly1305

Chain

Re-exports Chain

ChainHead

Renames and re-exports primitives/ChainHead

CompilerVersion

Renames and re-exports primitives/CompilerVersion

ContractCode

Renames and re-exports primitives/ContractCode

ContractResult

Renames and re-exports primitives/ContractResult

ContractSignature

Renames and re-exports primitives/ContractSignature

CryptoError

Re-exports CryptoError

DecodedData

Renames and re-exports primitives/DecodedData

DecodingError

Re-exports DecodingError

Domain

Renames and re-exports primitives/Domain

DomainSeparator

Renames and re-exports primitives/DomainSeparator

Ed25519

Re-exports Ed25519

EIP712

Re-exports EIP712

EncodedData

Renames and re-exports primitives/EncodedData

EncodingError

Re-exports EncodingError

Ens

Renames and re-exports primitives/Ens

Epoch

Renames and re-exports primitives/Epoch

ERC1155

Re-exports ERC1155

ERC165

Re-exports ERC165

ERC20

Re-exports ERC20

ERC721

Re-exports ERC721

ErrorSignature

Renames and re-exports primitives/ErrorSignature

Ether

Re-exports Ether

EventLog

Renames and re-exports primitives/EventLog

EventSignature

Renames and re-exports primitives/EventSignature

evm

Re-exports evm

FeeMarket

Re-exports FeeMarket

FilterId

Renames and re-exports primitives/FilterId

ForkId

Renames and re-exports primitives/ForkId

FunctionSignature

Renames and re-exports primitives/FunctionSignature

Gas

Renames and re-exports primitives/Gas

GasConstants

Renames and re-exports primitives/GasConstants

GasCosts

Re-exports GasCosts

GasEstimate

Renames and re-exports primitives/GasEstimate

GasRefund

Renames and re-exports primitives/GasRefund

GasUsed

Renames and re-exports primitives/GasUsed

Gwei

Re-exports Gwei

Hardfork

Renames and re-exports primitives/Hardfork

Hash

Re-exports Hash

HashType

Re-exports HashType

HDWallet

Re-exports HDWallet

Hex

Re-exports Hex

InitCode

Renames and re-exports primitives/InitCode

Int128

Re-exports Int128

Int16

Re-exports Int16

Int256

Re-exports Int256

Int32

Re-exports Int32

Int64

Re-exports Int64

Int8

Re-exports Int8

IntegerOverflowError

Re-exports IntegerOverflowError

IntegerUnderflowError

Re-exports IntegerUnderflowError

InvalidChecksumError

Re-exports InvalidChecksumError

InvalidFormatError

Re-exports InvalidFormatError

InvalidLengthError

Re-exports InvalidLengthError

InvalidPrivateKeyError

Re-exports InvalidPrivateKeyError

InvalidPublicKeyError

Re-exports InvalidPublicKeyError

InvalidRangeError

Re-exports InvalidRangeError

InvalidSignatureError

Re-exports InvalidSignatureError

InvalidSignerError

Re-exports InvalidSignerError

InvalidSizeError

Re-exports InvalidSizeError

InvalidTransactionTypeError

Re-exports InvalidTransactionTypeError

Keccak256Hash

Re-exports Keccak256Hash

Keccak256HashType

Renames and re-exports Keccak256Hash

Keccak256Native

Renames and re-exports Keccak256

Keystore

Renames and re-exports crypto/Keystore

KZG

Re-exports KZG

KzgBlobType

Renames and re-exports BlobType

KzgCommitmentType

Re-exports KzgCommitmentType

KzgProofType

Re-exports KzgProofType

License

Renames and re-exports primitives/License

LogFilter

Renames and re-exports primitives/LogFilter

LogIndex

Renames and re-exports primitives/LogIndex

MemoryDump

Renames and re-exports primitives/MemoryDump

Metadata

Renames and re-exports primitives/Metadata

ModExp

Re-exports ModExp

NativeErrorCodeType

Renames and re-exports NativeErrorCode

NetworkId

Renames and re-exports primitives/NetworkId

NodeInfo

Renames and re-exports primitives/NodeInfo

Opcode

Re-exports Opcode

OpStep

Renames and re-exports primitives/OpStep

P256

Re-exports P256

PeerId

Renames and re-exports primitives/PeerId

PeerInfo

Renames and re-exports primitives/PeerInfo

PendingTransactionFilter

Renames and re-exports primitives/PendingTransactionFilter

Permit

Renames and re-exports primitives/Permit

precompiles

Re-exports precompiles

PrimitiveError

Re-exports PrimitiveError

ProtocolVersion

Renames and re-exports primitives/ProtocolVersion

Proxy

Re-exports Proxy

Receipt

Renames and re-exports primitives/Receipt

ReturnData

Renames and re-exports primitives/ReturnData

RevertReason

Renames and re-exports primitives/RevertReason

Ripemd160

Re-exports Ripemd160

Ripemd160Hash

Re-exports Ripemd160Hash

Ripemd160HashType

Renames and re-exports Ripemd160Hash

Rlp

Re-exports Rlp

RuntimeCode

Renames and re-exports primitives/RuntimeCode

Secp256k1

Re-exports Secp256k1

Selector

Renames and re-exports primitives/Selector

SerializationError

Re-exports SerializationError

SHA256

Re-exports SHA256

SHA256Hash

Re-exports SHA256Hash

SHA256HashType

Renames and re-exports SHA256Hash

SignedData

Renames and re-exports primitives/SignedData

Siwe

Re-exports Siwe

Slot

Renames and re-exports primitives/Slot

SourceMap

Renames and re-exports primitives/SourceMap

Ssz

Re-exports Ssz

State

Renames and re-exports primitives/State

StateDiff

Renames and re-exports primitives/StateDiff

StealthAddress

Renames and re-exports primitives/StealthAddress

Storage

Re-exports Storage

StorageDiff

Renames and re-exports primitives/StorageDiff

StorageKey

Re-exports StorageKey

StructLog

Renames and re-exports primitives/StructLog

SyncStatus

Renames and re-exports primitives/SyncStatus

TopicFilter

Renames and re-exports primitives/TopicFilter

TraceConfig

Renames and re-exports primitives/TraceConfig

TraceResult

Renames and re-exports primitives/TraceResult

Transaction

Renames and re-exports primitives/Transaction

TransactionError

Re-exports TransactionError

TransactionHash

Renames and re-exports primitives/TransactionHash

TransactionIndex

Renames and re-exports primitives/TransactionIndex

TransactionStatus

Renames and re-exports primitives/TransactionStatus

TransactionUrl

Re-exports TransactionUrl

TypedData

Renames and re-exports primitives/TypedData

Uint

Re-exports Uint

Uint128

Re-exports Uint128

Uint16

Re-exports Uint16

Uint256

Renames and re-exports primitives/Uint

Uint32

Re-exports Uint32

Uint64

Re-exports Uint64

Uint8

Re-exports Uint8

Uncle

Renames and re-exports primitives/Uncle

ValidationError

Re-exports ValidationError

ValidatorIndex

Renames and re-exports primitives/ValidatorIndex

wasm

Re-exports wasm

Wei

Re-exports Wei

Withdrawal

Renames and re-exports primitives/Withdrawal

WithdrawalIndex

Renames and re-exports primitives/WithdrawalIndex

X25519

Re-exports X25519