I have implemented pallet_treasury just like Kusama, how do i find the resulting address?


3 Answers 3


Find the pallet id in runtime first. Different networks might use different id. Kusama treasury pallet id

Use subalfred.

λ subalfred key 'py/trsry' --key-type pallet --network kusama
public-key 0x6d6f646c70792f74727372790000000000000000000000000000000000000000 PalletId(py/trsry)
kusama F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29


  • Can I use this tool for a custom Substrate chain?
    – Bruno
    Aug 18, 2022 at 0:41
  • Sure. It use the same algorithm as substrate. —network just change the ss58 prefix. public key is the same. Aug 18, 2022 at 3:15
import { stringToU8a } from '@polkadot/util';
import { encodeAddress } from '@polkadot/util-crypto';

const treasuryAddress = encodeAddress(stringToU8a("modlpy/trsry".padEnd(32, '\0')))

Here's another using just subkey:

$ HEX=$(printf "modlpy/trsry" | xxd -p)
$ PUBLIC_KEY=$(printf 0x%-64s $HEX | tr " " 0)
$ subkey inspect $PUBLIC_KEY --network kusama --public
Network ID/Version: kusama
  Public key (hex):   0x6d6f646c70792f74727372790000000000000000000000000000000000000000
  Account ID:         0x6d6f646c70792f74727372790000000000000000000000000000000000000000
  Public key (SS58):  F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29
  SS58 Address:       F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.