BlsPoint.toBytes
Converts a BLS point to Bytes.Bytes
.
Imports
Named
import { BlsPoint } from 'ox'
Examples
Public Key to Bytes
import { Bls, BlsPoint } from 'ox'
const publicKey = Bls.getPublicKey({ privateKey: '0x...' })
const publicKeyBytes = BlsPoint.toBytes(publicKey)
Uint8Array [172, 175, 255, ...]
Signature to Bytes
import { Bls, BlsPoint } from 'ox'
const signature = Bls.sign({ payload: '0x...', privateKey: '0x...' })
const signatureBytes = BlsPoint.toBytes(signature)
Uint8Array [172, 175, 255, ...]
Definition
function toBytes<point>(
point: point,
): point extends G1 ? G1Bytes : G2Bytes
Source: src/core/BlsPoint.ts
Parameters
point
- Type:
point
The BLS point to convert.
Return Type
The bytes representation of the BLS point.
point extends G1 ? G1Bytes : G2Bytes