Skip to content

commitNEAR()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / commitNEAR

commitNEAR(value, blinding?): NEARPedersenCommitment

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18372

Create a Pedersen commitment to a value (ed25519)

C = vG + rH

bigint

The value to commit to (must be < curve order)

Uint8Array<ArrayBufferLike>

Optional blinding factor (random 32 bytes if not provided)

NEARPedersenCommitment

The commitment and blinding factor

// Commit to 1 NEAR (in yoctoNEAR)
const { commitment, blinding } = commitNEAR(1_000_000_000_000_000_000_000_000n)
// Verify the commitment
const valid = verifyOpeningNEAR(commitment, 1_000_000_000_000_000_000_000_000n, blinding)