> For the complete documentation index, see [llms.txt](https://calnix.gitbook.io/eth-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calnix.gitbook.io/eth-dev/introduction/accounts-and-signing.md).

# Accounts and Signing

### How does the blockchain know that the transaction sent is not forged?

#### Transactions are signed and can be verified to be authentic, like so:

For a transaction signature to be created, access to the account and its private key is required. Which is why, we need to unlock our MM, and sign before committing a transaction.

#### **Private Key: 32 bytes (64 hex characters)**

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FgMwat6MmM0HtSqKzfHnu%2Fimage.png?alt=media\&token=010ac86a-c166-4cbf-aff6-bcff5cb40176)

#### Public Key

The public key is generated from a private key, using ECDSA. This is a one-way function, the only way is to brute-force it.

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FHBm4jvgAsHcqIOCXdOYQ%2Fimage.png?alt=media\&token=f0d8b668-6015-4763-b884-4d5b6a99828d)

#### Ethereum Account (Wallet Address)

An Ethereum account is the Keccak Hash of the last 20 bytes (40 hex char) of the public key.

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FMd8vqjp8g5ifmbSpDseY%2Fimage.png?alt=media\&token=a2fa702e-b567-4edc-b868-4d8a1c13d5f7)

{% hint style="danger" %}
Can go from Private -> Public -> Account. No reverse.
{% endhint %}

### Signing & Verification

The transaction gets signed with the private key, creating additional fields of v,r,s. The signature is the r and s.

*You cannot reverse engineer the private key from the signature.*&#x20;

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FspBUlP7J1UDSnIKEYyyr%2Fimage.png?alt=media\&token=816d5c3e-cf7a-4e31-b6bc-f488340a778a)

With the r & s, you can run them through an ECRECOVER function, and it will output the Public Khey and Wallet Address (Eth account).

**This authenticates the transaction.**&#x20;
