> For the complete documentation index, see [llms.txt](https://apexpool.gitbook.io/stake-pool-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apexpool.gitbook.io/stake-pool-scripts/hardware-wallet-for-pledge/stake-key.md).

# Stake key

First thing required is extracting the stake key hardware signing file (".hwsfile") and the stake key verification key (".vkey") from the hardware wallet. For this, the `cardano-hw-cli` binary file is required (<https://github.com/vacuumlabs/cardano-hw-cli/releases/latest>).

Create the following script as `hw-keys.sh` and save it in the `keys` folder, where the `wallet.sh` script is also stored:

```bash
#!/bin/bash


cardano-hw-cli address key-gen \
--path 1852H/1815H/0H/2/0 \
--verification-key-file hw-stake.vkey \
--hw-signing-file hw-stake.hwsfile

#cardano-hw-cli address key-gen \
#--path 1852H/1815H/0H/0/0 \
#--verification-key-file hw-payment.vkey \
#--hw-signing-file hw-payment.hwsfile
```

Only the first command is required for the stake key, the second command is included as an example for extracting the hardware signing file for the first payment address of the hardware wallet.

The `hw-stake.hwsfile` file will be required for witnessing transactions with the hardware wallet, and the `hw-stake.vkey` file will be required when creating the new stake pool registration certificate.

The script must be executed with the hardware wallet connected to the computer and unlocked, and with the Cardano application started. It will be required to confirm the key export on the hardware wallet.


---

# 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://apexpool.gitbook.io/stake-pool-scripts/hardware-wallet-for-pledge/stake-key.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.
