Change unlock password of wallet with active host.



  • Hello fellow Sia users,
    I'm running a host on a headless server and want to change the wallet unlock pw from the long and bulky seed to a custom one.

    As far as I know the only way to set a custom pw is during the initialization "siac wallet init -p"
    Is there another option?
    If not, how can I create a new wallet and import the funds and host-contracts from the old wallet?

    kind regards



  • Currently there is no way to change the encryption password on an existing wallet. The workaround is, as you guessed, to create a new wallet. The API endpoint /wallet/init/seed can create a new wallet using your existing seed and a new password.

    Unfortunately, siac does not currently support the --force flag when using this endpoint. So you have two options:

    • Use curl to call the API endpoint: curl -A "Sia-Agent" -X POST "/wallet/init/seed?encryptionpassword=[pw]&seed=[seed]&force=true". I'm not sure if the seed needs to be manually URL-encoded (since it contains spaces) so this could take some fiddling.

    • Manually delete your existing wallet folder (while siad is stopped), then use the siac command siac wallet init-seed -p. You will be prompted for your old seed and new encryption password.

    Afterwards, unlock your wallet using the new password and it will begin resyncing. This can take a while because the wallet has to process the whole blockchain. Also, you should backup your existing seed and wallet folder beforehand just in case something goes wrong.

    EDIT: we just added the --force flag to siac wallet init-seed. It will be included in the next release. Or if you're able to compile Sia from source, you can use it immediately by pulling the latest master branch. :)



  • thanks for your answer, I will just wait for the next release and do it the official way.
    Anyway I will create a backup of the /wallet and /seed folder before the (re-) initialization.



  • hm I tried it after upgrading to 1.2.1. and it seems the -p flag is no option

    tested command: ./siac wallet init-seed --force -p

    output:
    Error: unknown shorthand flag: 'p' in -p
    Usage:
    ./siac wallet init-seed [flags]

    Flags:
    --force destroy the existing wallet

    Global Flags:
    -a, --addr string which host/port to communicate with (i.e. the host/port siad is listening on) (default "localhost:9980")



  • Any thoughts on my issue?


  • admins

    yeah, looks like we need to add the -p flag to init-seed. Will have that released soon, alongside the other wallet fixes.


Log in to reply