3
votes
How can I convert from cborHex to VRFKeyHash type from the Cardano Serialization Lib?
Verification keys can be represented in different ways. The one that you want is a representation where the key hash is converted with a prefix vrf_ to the bech32 format. This can be done via the ...
3
votes
Accepted
Hash script data
The missing step would be converting the ScriptData into
CBOR prior to hashing.
In the case of ScriptDataNumber 42 the CBOR Hex is "182a" which is a bit simplified for Numbers vs more ...
3
votes
Accepted
How to get PubKeyHash of an address without vkey?
You can see the CDDL spec for full details: https://github.com/input-output-hk/cardano-ledger/blob/master/eras/shelley/test-suite/cddl-files/shelley.cddl
In the case of a payment base address (the ...
2
votes
How to get a base 16 hex BuiltinString from getTxId
I was able to resolve this issue by converting (encoding) the BuiltinByteString from getTxId into a hex format. From there I was able to inpsect the hex digits. Below is an onchain encodeHex ...
2
votes
Accepted
How can I convert from cborHex to VRFKeyHash type from the Cardano Serialization Lib?
To convert from cborHex to VRFKeyHash I did the following, assuming there's a file with this format...
{
"type": "VrfVerificationKey_PraosVRF",
"description": &...
2
votes
Accepted
How can I convert the hex hash ID of a stake pool to "pool1..." format in Javascript or TypeScript?
The encoding is called Bech32.
I suspect that cardano-addresses can do this conversion.
2
votes
cardano-db-sync different tx, same hash?
I'm listening for new records added on block table and have noticed that sometimes two blocks are added almost at the same time with basically the same info except for block hash.
Yes this is a ...
1
vote
How can I convert the hex hash ID of a stake pool to "pool1..." format in Javascript or TypeScript?
You can do it with the bech32 command (which comez in the cardano-wallet package, if you don't already have it):
bech32 pool <<< <hex_pool_id>
1
vote
Accepted
How Does the Blockchain Use Hashes?
The Cardano code does not use SHA256 or SHA512, but rather uses 2 different versions of the Blake2 hash functions (but Plutus may use SHA hashes).
Hash functions are used in several places. Two simple ...
1
vote
Accepted
How to retrieve staking credential hash
You require an instance of type BaseAddress which you can get using a bech32 formatted address (addr_... or addr_test...). Here an example:
const bech32Addr = "...
1
vote
Is there a way to validate a policy Id,and to check if a string is an actual policy id?
Beyond the length of the hash digest (28 bytes in this case), no. Unless you have the pre-image (that is, the raw policy script) in which case you can rehash it and compare.
1
vote
1
vote
How to get PubKeyHash of an address without vkey?
Check out cardano-addresses, and scroll to the "how to inspect address" section
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hash × 14plutus × 4
cardano-cli × 4
script × 3
cardano-serialization-lib × 3
transaction × 2
on-chain × 2
wallet × 1
stake-pool × 1
ada × 1
nft × 1
native-assets × 1
address × 1
utxo × 1
plutustx × 1
cardano-address × 1
cardano-db-sync × 1
attacks × 1
converter × 1
bech32 × 1
blake2b × 1
cbor × 1
private-key × 1
public-key × 1
validator × 1