# signCompact

Description: signCompact cheatcode documentation

Note: This document was authored using MDX

  Source: https://github.com/NomicFoundation/hardhat-website/tree/main/src/content/docs/docs/reference/cheatcodes/Signing/sign-compact.mdx

### Signature

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

### Description

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.
