Skip to content

VirtualMaster.mineSalt

Searches a bounded range of salts for the first value that satisfies TIP-1022 PoW.

TIP-1022

This is intentionally a small, deterministic primitive. It does not coordinate workers or async execution. Callers that need large searches can shard ranges externally.

Master addresses must satisfy TIP-1022 registration constraints: they cannot be the zero address, another virtual address, or a TIP-20 token address.

Imports

Named
import { VirtualMaster } from 'ox/tempo'

Examples

import { Address } from 'ox'
import { VirtualMaster } from 'ox/tempo'
 
const result = VirtualMaster.mineSalt({
  address: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
})
 
result?.salt
'0x00000000000000000000000000000000000000000000000000000000abf52baf'

Definition

function mineSalt(
  value: mineSalt.Value,
): mineSalt.ReturnType | undefined

Source: src/tempo/VirtualMaster.ts

Parameters

value

  • Type: mineSalt.Value

Search range parameters.

value.address

  • Type: TempoAddress.Address

Master address. Accepts both hex and Tempo addresses.

value.count

  • Type: number
  • Optional

Number of consecutive salts to try.

value.start

  • Type: Salt
  • Optional

Starting salt value.

Return Type

The first matching salt in the range, if any.

mineSalt.ReturnType | undefined