Skip to content

Latest commit

 

History

History
372 lines (216 loc) · 8 KB

File metadata and controls

372 lines (216 loc) · 8 KB

@ethereumjs/verkle

@ethereumjs/verkle

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

Checkpoint

Ƭ Checkpoint: Object

Type declaration

Name Type
keyValueMap Map<string, Uint8Array | undefined>
root Uint8Array

Defined in

types.ts:104


FoundNodeFunction

Ƭ FoundNodeFunction: (nodeRef: Uint8Array, node: VerkleNode | null, key: Uint8Array, walkController: WalkController) => void

Type declaration

▸ (nodeRef, node, key, walkController): void

Parameters
Name Type
nodeRef Uint8Array
node VerkleNode | null
key Uint8Array
walkController WalkController
Returns

void

Defined in

types.ts:111


Proof

Ƭ Proof: Uint8Array[]

Defined in

types.ts:61


VerkleNode

Ƭ VerkleNode: TypedVerkleNode[VerkleNodeType]

Defined in

node/types.ts:15


VerkleTreeOptsWithDefaults

Ƭ VerkleTreeOptsWithDefaults: VerkleTreeOpts & { cacheSize: number ; useRootPersistence: boolean }

Defined in

types.ts:87

Variables

NODE_WIDTH

Const NODE_WIDTH: 256

Defined in

node/types.ts:49


POINT_IDENTITY

Const POINT_IDENTITY: Point

Defined in

util/crypto.ts:81


ROOT_DB_KEY

Const ROOT_DB_KEY: Uint8Array

Defined in

types.ts:118

Functions

decodeNode

decodeNode(raw): VerkleNode

Parameters

Name Type
raw Uint8Array

Returns

VerkleNode

Defined in

node/util.ts:20


decodeRawNode

decodeRawNode(raw): VerkleNode

Parameters

Name Type
raw Uint8Array[]

Returns

VerkleNode

Defined in

node/util.ts:7


getKey

getKey(stem, subIndex): Uint8Array

Dev

Returns the tree key for a given verkle tree stem, and sub index.

Dev

Assumes that the verkle node width = 256

Parameters

Name Type Description
stem Uint8Array The 31-bytes verkle tree stem as a Uint8Array.
subIndex Uint8Array The sub index of the tree to generate the key for as a Uint8Array.

Returns

Uint8Array

The tree key as a Uint8Array.

Defined in

util/crypto.ts:67


getStem

getStem(address, treeIndex?): Uint8Array

Dev

Returns the 31-bytes verkle tree stem for a given address and tree index.

Dev

Assumes that the verkle node width = 256

Parameters

Name Type Default value Description
address Address undefined The address to generate the tree key for.
treeIndex number | bigint 0 The index of the tree to generate the key for. Defaults to 0.

Returns

Uint8Array

The 31-bytes verkle tree stem as a Uint8Array.

Defined in

util/crypto.ts:43


isRawNode

isRawNode(node): node is Uint8Array[]

Parameters

Name Type
node Uint8Array | Uint8Array[]

Returns

node is Uint8Array[]

Defined in

node/util.ts:28


matchingBytesLength

matchingBytesLength(bytes1, bytes2): number

Compares two byte arrays and returns the count of consecutively matching items from the start.

Function

Parameters

Name Type Description
bytes1 Uint8Array The first Uint8Array to compare.
bytes2 Uint8Array The second Uint8Array to compare.

Returns

number

The count of consecutively matching items from the start.

Defined in

util/bytes.ts:9


pedersenHash

pedersenHash(input): Uint8Array

Parameters

Name Type
input Uint8Array

Returns

Uint8Array

Defined in

util/crypto.ts:14


verifyProof

verifyProof(root, proof, keyValues): Uint8Array

Parameters

Name Type
root Uint8Array
proof Uint8Array
keyValues Map<any, any>

Returns

Uint8Array

Defined in

util/crypto.ts:72


verifyUpdate

verifyUpdate(root, proof, keyValues): Uint8Array

Parameters

Name Type
root Uint8Array
proof Uint8Array
keyValues Map<any, any>

Returns

Uint8Array

Defined in

util/crypto.ts:28