nostr-websocket-utils

nostr-websocket-utils v0.3.16


nostr-websocket-utils / calculatePowEventId

Function: calculatePowEventId()

calculatePowEventId(event, targetDifficulty, maxAttempts?): Promise<string>

Defined in: nips/nip-13.ts:37

Calculates event ID with proof of work

Parameters

event

Record<string, unknown>

Event object without ID

targetDifficulty

number

Target number of leading zero bits

maxAttempts?

number = 1000000

Maximum number of attempts

Returns

Promise<string>

Event ID with sufficient proof of work