> For the complete documentation index, see [llms.txt](https://satoshichain.gitbook.io/satoshi-chain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://satoshichain.gitbook.io/satoshi-chain/background/3.2-digital-signatures/3.2.2-ecdsa-signature-algorithm.md).

# 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    𝑠'

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://satoshichain.gitbook.io/satoshi-chain/background/3.2-digital-signatures/3.2.2-ecdsa-signature-algorithm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
