Hot answers tagged

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 ...
Fermat's user avatar
  • 1,862
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 ...
Luigy's user avatar
  • 46
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 ...
Samuel Leathers's user avatar
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 ...
lley154's user avatar
  • 297
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": &...
Falcon Stakepool's user avatar
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.
Erik de Castro Lopo's user avatar
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 ...
Erik de Castro Lopo's user avatar
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>
George - APEX Stake Pool's user avatar
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 ...
Erik de Castro Lopo's user avatar
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 = "...
Will's user avatar
  • 1,162
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.
KtorZ's user avatar
  • 495
1 vote

Building a bridge to Hedera Hashgraph HBAR

There is no such bridge to my knowledge.
Marek Mahut - StakeNuts's user avatar
1 vote

How to get PubKeyHash of an address without vkey?

Check out cardano-addresses, and scroll to the "how to inspect address" section
zhekson's user avatar
  • 3,629

Only top scored, non community-wiki answers of a minimum length are eligible