Skip to content

BlsPoint.toHex

Converts a BLS point to Hex.Hex.

Imports

Named
import { BlsPoint } from 'ox'

Examples

Public Key to Hex

import { Bls, BlsPoint } from 'ox'
 
const publicKey = Bls.getPublicKey({ privateKey: '0x...' })
const publicKeyHex = BlsPoint.toHex(publicKey)
'0xacafff52270773ad1728df2807c0f1b0b271fa6b37dfb8b2f75448573c76c81bcd6790328a60e40ef5a13343b32d9e66'

Signature to Hex

import { Bls, BlsPoint } from 'ox'
 
const signature = Bls.sign({ payload: '0x...', privateKey: '0x...' })
const signatureHex = BlsPoint.toHex(signature)
'0xb4698f7611999fba87033b9cf72312c76c683bbc48175e2d4cb275907d6a267ab9840a66e3051e5ed36fd13aa712f9a9024f9fa9b67f716dfb74ae4efb7d9f1b7b43b4679abed6644cf476c12e79f309351ea8452487cd93f66e29e04ebe427c'

Definition

function toHex<point>(
  point: point,
): point extends G1 ? G1Hex : G2Hex

Source: src/BlsPoint.ts

Parameters

point

  • Type: point

The BLS point to convert.

Return Type

The hex representation of the BLS point.

point extends G1 ? G1Hex : G2Hex