# ECDSA key generation

The **ECDSA key-pair** consists of:

* **private key** (integer): ***privKey***
* **public key** (EC point): ***pubKey*** = ***privKey*** \* **G**

The **private key** is generated as a **random integer** in the range \[0...***n***-1]. The public key ***pubKey*** is a point on the elliptic curve, calculated by the EC point multiplication: ***pubKey*** = ***privKey*** \* **G** (the private key, multiplied by the generator point **G**).

The public key EC point {***x***, ***y***} can be **compressed** to just one of the coordinates + 1 bit (parity). For the `secp256k1` curve, the private key is 256-bit integer (32 bytes) and the compressed public key is 257-bit integer (\~ 33 bytes).

[Source](https://cryptobook.nakov.com/digital-signatures/ecdsa-sign-verify-messages)


---

# Agent Instructions: 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:

```
GET https://docs-protocol.loopring.io/resources/signature/ecdsa-signature/ecdsa-key-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
