---
description: >-
  In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) is a
  digital signature algorithm that uses the secp256k1 curve to create and verify
  digital signatures.
---

# 3.2.2 ECDSA Signature Algorithm

### ECDSA Signature Algorithm <a href="#ecdsa-signature-algorithm" id="ecdsa-signature-algorithm"></a>

Elliptic Curve Digital Signature Algorithm (ECDSA) is a cryptographic algorithm for creating digital signatures. More concretely,\
\
**Setup**

```
●	Public Parameters: Let 𝐹 be a finite field, two parameters 𝑎 and 𝑏 define an elliptic
𝑞 
curve 𝐶 over 𝐹 , a seed which validates 𝐶, a prime integer
𝑞
𝐺∈ 𝐶 of order 𝑛 where 𝑞 is either prime or a power of 2.
●	Private Key: An integer 𝑑 in [1, 𝑛 − 1].
●	Public Key: 𝑄 = 𝑑𝐺.
```

**Signature generation for a given message 𝑀:**

```
●	Generate 𝑘∈ [1, 𝑛 − 1]
●	Compute
(𝑥1, 𝑦1) = 𝑘𝐺
𝑟 = 𝑥1 𝑚𝑜𝑑 𝑛
𝑠 =	 𝐻(𝑀) + 𝑑𝑟  𝑚𝑜𝑑 𝑛
●	If 𝑟 = 0 or 𝑠 = 0, try again. The signature is (𝑟, 𝑠).
●	Signature: (𝑀, 𝑟 , 𝑠 ). 
```

**Verification:**

```
●	Given (𝑀, 𝑟 ', 𝑠' ).
●	Verify if 𝑟' and 𝑠' are in [1, 𝑛 − 1] and that 𝑟' = 𝑥 𝑚𝑜𝑑 𝑛 for
(𝑥 , 𝑦 ) = 𝑢 𝐺 + 𝑢 𝑄  =   𝐻(𝑀)  𝑚𝑜𝑑 𝑛, and 𝑢 =  𝑟'  𝑚𝑜𝑑 𝑛.s')
𝑢

1    1    1        2    1    𝑠'        2    𝑠'

```
