Restake
Auto-compounder script for Cosmos Validators using REStake
Install / Use
/learn @eco-stake/RestakeREADME
REStake
REStake allows delegators to grant permission for a validator to compound their rewards, and provides a script validators can run to find their granted delegators and send the compounding transactions automatically.
REStake is also a convenient staking tool, allowing you to claim and compound your rewards individually or in bulk. This can save transaction fees and time, and many more features are planned.
Try it out at restake.app.
The REStake UI has it's own dedicated repository at eco-stake/restake-ui.
How it works / Authz
Authz is a new feature for Tendermint chains which lets you grant permission to another wallet to carry out certain transactions for you. These transactions are sent by the grantee on behalf of the granter, meaning the validator will send and pay for the TX, but actions will affect your wallet (such as claiming rewards).
REStake specifically lets you grant a validator permission to send Delegate transactions for their validator only. The validator cannot send any other transaction types, and has no other access to your wallet. You authorize this using Keplr as normal. REStake no longer requires a Withdraw permission to autostake.
A script is also provided which allows a validator to automatically search their delegators, check each for the required grants, and if applicable carry out the claim and delegate transactions on their behalf in a single transaction. This script should be run daily, and the time you will run it can be specified when you add your operator.
Limitations
- Authz is also not fully supported yet. Many chains are yet to update. The REStake UI will fall back to being a manual staking app with useful manual compounding features.
- Currently REStake needs the browser extension version of Keplr, but WalletConnect and Keplr iOS functionality will be added ASAP.
- REStake requires Nodejs version 20.x or later, it will not work with earlier versions.
Become an operator
Becoming an operator is pretty easy, the overall process is as follows:
- Setup your bot wallet
- Setup the autostaking script
- Setup a cron or timer to run the script on a schedule
- Submit your operator to Validator Registry
Setup a hot wallet
Generate a new hot wallet you will use to automatically carry out the staking transactions. The mnemonic will need to be provided to the script so use a dedicated wallet and only keep enough funds for transaction fees. The ONLY mnemonic required here is for the hot wallet, do not put your validator operator mnemonic anywhere.
You only need a single mnemonic for multiple Cosmos chains, and the script will check each network in the networks.json file for a matching bot address.
Derivation Paths (IMPORTANT)
Right now, the REStake autostaking script uses the standard 118 derivation path by default. Some networks prefer a different path and apps like Keplr will honour this. The address the autostake script uses might not match Keplr.
As there are existing operators using the 118 path, operators will need to opt in to the correct path when they want to upgrade. New operators should use the correct path before they get grants.
The correct path can be set in one of two ways using a config override file. "correctSlip44": true will use the slip44 defined in the Chain Registry. Alternatively set a specific path using "slip44": 69. You should use "correctSlip44": true if possible.
{
"desmos": {
"prettyName": "Desmos 852",
"autostake": {
"correctSlip44": true
}
}
}
In the future, correctSlip44 will become the default and you will need to set slip44 explicitly if you want to use the 118 path.
Setup the autostaking script
You can run the autostaking script using docker-compose or using npm directly. In both cases you will need to provide your mnemonic in a MNEMONIC environment variable.
Instructions for Docker Compose
Install Docker and Docker Compose
Best bet is to follow the Docker official guides. Install Docker first, then Docker Compose. In recent versions, Docker and Docker Compose may combined into a single installation.
Docker: docs.docker.com/get-docker
Docker Compose: docs.docker.com/compose/install
Clone the repository and setup .env
Clone the repository and copy the sample .env file ready for your mnemonic.
git clone https://github.com/eco-stake/restake
cd restake
cp .env.sample .env
Populate your new .env file with your mnemonic.
Instructions for NPM
Install nodejs@v20
curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
# read the script file and when you're sure it's safe run it
chmod +x /tmp/nodesource_setup.sh
/tmp/nodesource_setup.sh
apt install nodejs -y
node --version
> v20.9.0
npm --version
> 10.1.0
Clone the repository and build it
git clone https://github.com/eco-stake/restake
cd restake
npm install
cp .env.sample .env
Populate your new .env file with your mnemonic.
Updating your local version
REStake is MVP. Very MVP. Updates are happening all the time and there are bugs that still need fixing. Make sure you update often.
Update your local repository and pre-build your Docker containers with the following commands:
git pull
docker-compose run --rm app npm install
docker-compose build --no-cache
or with NPM:
git pull
npm install
Running the script
Running the autostake script manually is then simple.
If you use Docker then you should prefix the below commands with docker-compose run --rm app.
Note you might need sudo depending on your docker install, and some docker versions utilize docker compose instead of docker-compose. If you run into issues, try substituting docker compose.
docker-compose run --rm app npm run autostake
Alternatively if you use NPM you can ignore the docker-compose run --rm app prefix:
npm run autostake
Pass network names to restrict the script to certain networks.
npm run autostake osmosis akash regen
A Dry Run script is also included, which runs the normal autostake script but skips sending the final TXs, and skips any health check pings.
npm run dryrun osmosis
You should expect to see a warning that you are 'not an operator' until your REStake operator information is submitted in Submitting your operator
Customise REStake and use your own node
You will likely want to customise your networks config, e.g. to set your own node URLs to ensure your autocompounding script completes successfully.
Create a src/networks.local.json file and specify the networks you want to override. Alternatively, set the NETWORKS_OVERRIDE_PATH environment variable containing the filepath. The below is just an example, you should only override a config if you need to.
{
"osmosis": {
"prettyName": "Osmosis",
"restUrl": [
"https://rest.cosmos.directory/osmosis"
],
"gasPrice": "0.0025uosmo",
"autostake": {
"retries": 3,
"batchPageSize": 100,
"batchQueries": 25,
"batchTxs": 50,
"delegationsTimeout": 20000,
"queryTimeout": 5000,
"queryThrottle": 100,
"gasModifier": 1.1
},
"operator": {
"address": "OVERRIDE_BOT_ADDRESS",
"minimumReward": "OVERRIDE_BOT_MINIMUM_REWARD"
},
"healthCheck": {
"uuid": "XXXXX-XXX-XXXX"
}
},
"desmos": {
"prettyName": "Desmos 118",
"autostake": {
"correctSlip44": true
}
},
"cosmoshub": {
"enabled": false
}
}
Any values you specify will override the networks.json file. These are examples, you can override as much or little as you need.
Arrays will be replaced and not merged. The file is .gitignore'd so it won't affect upstream updates.
Note that REStake requires a node with indexing enabled and minimum gas prices matching the networks.json gas price (or your local override).
Setting up cron/timers to run the script on a schedule
You should setup your script to run at the same time each day. 2 methods are described below; using crontab or using systemd-timer.
In both cases, ensure your system time is correct and you know what time the script will run in UTC, as that will be required later. Both examples below are for 21:00.
Don't forget to update often!
Using crontab
Note: A helpful calculator for determining your REStake timer for crontab can be found here: https://crontab.guru/.
Updated versions utilize docker compose instead of docker-compose. If you run into issues, try substituting docker compose.
crontab -e
0 21 * * * /bin/bash -c "cd restake && docker compose run --rm app npm run autostake" > ./restake.log 2>&1
or with NPM:
crontab -e
0 21 * * * /bin/bash -c "cd restake && npm run autostake" > ./restake.log 2>&1
Warning: Using crontab with docker without the --rm flag will continuously create docker images. Add another cronjob to tear down the images weekly if required:
crontab -e
0 0 * * */7 /usr/bin/docker image prune -a -f
Using systemd-timer
Systemd-timer allows to run a one-off service with specified rules. This method is arguably preferable to Cron.
Create a systemd unit file
The unit file describes the application to run. We define a dependency with the timer with the Wants statement.
sudo vim /etc/systemd/system/restake.service
[Unit]
Description=restake service with docker compose
Requires=docker.service
After
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

