breakPublicKeyIntoTwoParts
Umbra SDK reference for Break Public Key Into Two Parts.
Defined in: src/utils/miscellaneous.ts:493
Splits a Solana public key into two 128-bit limbs.
Parameters
publicKey
The SolanaAddress to split.
Returns
A tuple [lo, hi] of U128 values representing the first and second halves
of the public key bytes, interpreted as little-endian 128-bit integers.
Remarks
This is useful when a 256-bit public key needs to be represented as two field elements (e.g. for zero-knowledge circuits or Poseidon hashing) without losing information.
Example
const [lo, hi] = breakPublicKeyIntoTwoParts(userPublicKey);
console.log(lo.toString(), hi.toString());