Hot answers tagged

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 ...
  • 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 ...
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 ...
  • 233
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 ...
2 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 ...
  • 1,633
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.
  • 475
1 vote

How can I convert the hex hash ID of a stake pool to "pool1..." format?

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

How can I convert the hex hash ID of a stake pool to "pool1..." format?

The encoding is called Bech32. I suspect that cardano-addresses can do this conversion.
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
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": &...
1 vote

Building a bridge to Hedera Hashgraph HBAR

There is no such bridge to my knowledge.
1 vote

How to get PubKeyHash of an address without vkey?

Check out cardano-addresses, and scroll to the "how to inspect address" section
  • 3,374

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