Skip to content

signCompact

function signCompact(
uint256 privateKey,
bytes32 digest
) external pure returns (bytes32 r, bytes32 vs);

Signs digest with privateKey using the secp256k1 curve. Returns a compact signature (r, vs) as per EIP-2098, where vs encodes both the signature’s s value, and the recovery id v in a single bytes32. This format reduces the signature size from 65 to 64 bytes.