I am tiring to use Cardano Sterilization Lib to get the Stake/Usable address from Stake Hash or Address Hash.


Address Hash: 01daaf711704003ec3d62ba63ab7fc82c52fdfadbe4a34e97158cafe5098ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27

Stake Key Hash: e198ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27

I saw Convert xpub public key from ccvault to bech32 or acct_ public key which showed a way but I couldn't get it to work.

wasm.StakeCredential.from_bytes(new TextEncoder().encode("98ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27"))

returns Deserialization failed in StakeCredential because: Invalid cbor: not the right type, expected Array' byte received Text'.


1 Answer 1


You can try with this line:

 Buffer.from("98ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27", "hex")

Alternatively, you can try using from_keyhash method. This method expects to receive a Ed25519KeyHash, which you can build from the given Stake Key Hash, all in the same instruction, like this:

  Buffer.from("e198ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27", "hex")

Your Answer

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

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