# UpdateAccount with custom seed

The eddsaKey is generated by a keyseed, default format is `Sign this message to access Loopring Exchange: %s with key nonce: %d`&#x20;

* %s is [exchange address](https://docs-uat.loopring.io/en/dex_apis/getExchangeInfo.html)
* %d is nonce in [Get api/v3/account](https://docs-uat.loopring.io/en/dex_apis/getAccount.html)

For example:

```
Sign this message to access Loopring Exchange: 0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e with key nonce: 0
```

We also support custom keyseed when `updateAccount`.

For example, you can change the string before 'with key nonce: 0' (must end with 'with key nonce: %d')

```
Sign this message to access XXX website with key nonce: 0
```

### 1. Update Account with keySeed

POST api: [api/v3/account](https://docs-uat.loopring.io/en/dex_apis/submitUpdateAccount.html)

Note: after `updateAccount`, the nonce in [Get api/v3/account](https://docs-uat.loopring.io/en/dex_apis/getAccount.html) will be incremented by 1

```
header: 
X-API-SIG = 0x05b49f99ac6d8f67d4519dfaf9b545dbc775dcc837441f85ef9aae74c83e5c2d700729cdba1d7a9cc818abb43a598cf1e4eeca547e4e6697ff18c4d2ac111ac21b03

request:
{
	"accountId": 11329,
	"ecdsaSignature": "0x05b49f99ac6d8f67d4519dfaf9b545dbc775dcc837441f85ef9aae74c83e5c2d700729cdba1d7a9cc818abb43a598cf1e4eeca547e4e6697ff18c4d2ac111ac21b03",
	"exchange": "0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e",
	"maxFee": {
		"volume": "24000000000000",
		"tokenId": 0
	},
	"nonce": 0,
	"owner": "0x8656920c85342d646E5286Cb841F90209272ABeb",
	"publicKey": {
		"x": "0x20ba7bd404f259c3d49853d6a849425a983c24fc3c01be177f719e84ba776a8c",
		"y": "0x266d7e40dba375c90816287814f20b8e187227a6d05f17d2d329fefac9b782af"
	},
	"validUntil": 1899273791,
	"keySeed":"Sign this message to access Loopring Exchange: 0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e with key nonce: 0"
}

response:
{
	"hash": "0x1d01dd0f4d7846a90235331798f4457829e72d8a4ed8d9393dd29c4859481e7b",
	"status": "processing",
	"isIdempotent": false
}
```

{% hint style="info" %}
Please also refer to js sdk for updateAccount: <https://github.com/Loopring/loopring\\_sdk/blob/master/src/tests/user.test.ts#L219>
{% endhint %}

### 2. Get Account

Get API: [api/v3/account](https://docs-uat.loopring.io/en/dex_apis/getAccount.html)

```
https://uat2.loopring.io/api/v3/account?owner=0x8656920c85342d646E5286Cb841F90209272ABeb

respone:
{
	"accountId": 11329,
	"owner": "0x8656920c85342d646E5286Cb841F90209272ABeb",
	"frozen": false,
	"publicKey": {
		"x": "0x20ba7bd404f259c3d49853d6a849425a983c24fc3c01be177f719e84ba776a8c",
		"y": "0x266d7e40dba375c90816287814f20b8e187227a6d05f17d2d329fefac9b782af"
	},
	"tags": "",
	"nonce": 1,
	"keyNonce": 1,
	"keySeed": "Sign this message to access Loopring Exchange: 0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e with key nonce: 0"
}
```

Then use the keySeed to generate eddsaKey.

{% hint style="info" %}
Please refer to js sdk for generating EdDSA keypair: <https://github.com/Loopring/loopring\\_sdk/blob/master/src/api/sign/sign\\_tools.ts#L70>
{% endhint %}


---

# 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/advanced/updateaccount-with-custom-seed.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.
