---
eip: 8111
label: ERC-8111
title: Bound Signatures
status: Review
type: Standards Track
category: ERC
created: 2025-12-23
official: https://eips.ethereum.org/EIPS/eip-8111
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8111.md
canonical: https://eips.huatuo.xyz/eip-8111/
lang: en
tldr: Shrinks ECDSA signatures for contracts to 64 bytes by always using v = 27 and flipping s when needed, so they stay directly usable with ecrecover and are non-malleable.
tags: [signatures, ecdsa, ecrecover, calldata, erc]
---

# ERC-8111: Bound Signatures

> Binding y-parity compresses ECDSA signatures

**TL;DR:** Shrinks ECDSA signatures for contracts to 64 bytes by always using v = 27 and flipping s when needed, so they stay directly usable with ecrecover and are non-malleable.

## What problem does it solve?

An Ethereum ECDSA signature is usually passed as `v`, `r`, `s`. ABI-encoded, that is 96 bytes, even though `v` only carries one bit (27 or 28). On top of that, for every valid `(v, r, s)` there is a second valid signature `(v', r, n - s)` with the opposite `v`, so signatures are *malleable* unless a contract restricts them.

[ERC-2098](/eip-2098/) already compresses signatures to 64 bytes by packing the parity bit into `s`, but the contract must unpack it before calling `ecrecover`. Bound Signatures get the same size with no unpacking.

## How it works

Because `(27, r, s)` and `(28, r, n - s)` recover the same signer, any signature can be rewritten into an equivalent one whose `v` is 27. This is called **binding** the signature.

- Contracts that accept bound signatures **must** call `ecrecover(digest, 27, r, s)` and must not accept any other `v`. They then only need `r` and `s` (64 bytes).
- Signers (or the client submitting the signature) must bind it first: if `v` is 28, replace `s` with `n - s` (where `n` is the secp256k1 group order).
- Fixing `v` removes the second valid form, so bound signatures are not malleable. Allowing both 27 and 28 would reintroduce malleability.
- 27 was chosen so the y-parity is "falsy".

## Sample code

Binding a signature off-chain (ethers v6) and verifying it on-chain:

```ts
import { Wallet, Signature } from "ethers";

const N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n;

function bind(sig: Signature): { r: string; s: string } {
  if (sig.v === 27) return { r: sig.r, s: sig.s };
  const s = N - BigInt(sig.s);
  return { r: sig.r, s: "0x" + s.toString(16).padStart(64, "0") };
}

const wallet = Wallet.createRandom();
const sig = wallet.signingKey.sign(digest); // digest: 32-byte hash
const { r, s } = bind(sig);                 // 64 bytes total
```

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.30;

library BoundSignatures {
    function recover(bytes32 digest, bytes32 r, bytes32 s) internal pure returns (address signer) {
        signer = ecrecover(digest, 27, r, s);
        require(signer != address(0));
    }
}
```

## Things to know

- Status is **Review**; the interface may still change.
- Bound signatures often have a "high" `s`, which [EIP-2](/eip-2/) forbids for transaction signatures. They are only for contracts that verify via `ecrecover`, not for signing transactions.
- Libraries that reject high-`s` values (for example OpenZeppelin's `ECDSA.recover`) will reject bound signatures; call `ecrecover` directly as shown.
- Always check that the recovered address is non-zero, and still use a proper digest scheme such as [EIP-712](/eip-712/) with nonces to prevent replay.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8111
