14 votes
Accepted

How to establish trust between a user's wallet, and the backend of a website?

For anyone looking for a more exact solution, below is an explanation for how I implemented this in JavaScript. To understand the authentication flow, I started by reading this article. While the ...
Matt Halloran's user avatar
7 votes
Accepted

Cardano Serialization Lib Usage

Generally I think you can say the point of the serialization lib is to help you manage the off-chain aspects of preparing transactions before you submit them to the network. It's a standalone library ...
sean's user avatar
  • 1,463
6 votes
Accepted

How to convert a Stake Key Address from hash to BECH32?

The beech32 representation is a bit tricky, but you can do it like this: const stakeKey = StakeCredential.from_bytes(from_hex('7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc')); const ...
Jan B.'s user avatar
  • 76
6 votes

window.cardano undefined

I am using this code in react: const isBrowser = () => typeof window !== "undefined"; export const getCardano = (): Cardano | undefined => { const cardano = isBrowser() && ...
Will's user avatar
  • 1,162
5 votes

How to generate the address of a plutus script using Cardano Serialization Lib?

Plutus-Core script bytes are wrapped twice in a CBOR bytearray. Use the following steps to calculate the script address: unwrap one layer of CBOR prepend a byte representing the PlutusScript version: ...
Christian Schmitz's user avatar
5 votes
Accepted

How to fetch assets siting on an adress using cardano serialization library and Nami wallet?

You could try this out. Basically assets are under value.multiassets() and is a double map from policy ID => assetName => quantity. You can iterate over this map with 2 for loops: const value = ...
Alessandro Konrad's user avatar
5 votes
Accepted

Plutus V2 Tx Building causing NonOutputSupplimentaryDatums error

I don't use cardano-serialization-lib but I can tell you that NonOutputSupplimentaryDatums is the ledger error thrown when datum is unneceserilly included in the tx when using inline datum. When ...
james's user avatar
  • 1,505
4 votes

Check status of past transaction using cli

The main option you have with cardano-cli is to keep running cardano-cli query utxo --tx-in df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#0 --mainnet Where ...
keefie's user avatar
  • 431
3 votes
Accepted

Is it possible to get root key from CLI generated private key?

You can use that key to sign transactions in cardano-serialization lib, but I believe you can't go back to a seed phrase or root key / other key derivations from it. To use it for signing transactions,...
sean's user avatar
  • 1,463
3 votes

How to new Cardano.Bip32PrivateKey from cborHex in file .skey generate by cardano-cli

The CLI key you generate is not the same as Bip32PrivateKey associated with HD Wallet, the Root key you're considering is green box below - while the CLI key is red one. You can derive from parent key ...
RdLrT's user avatar
  • 1,577
3 votes
Accepted

How to select UTXOs needed for covering a given ada amount using the Cardano Serialization Lib?

You are speaking about what we call Coin Selection Algorithms and they are described in CIP2. There are several implementations floating around on Github, such as BerryPool implementation of the ...
Marek Mahut - StakeNuts's user avatar
3 votes

How to establish trust between a user's wallet, and the backend of a website?

There are a few options for something like this, Nami specifically supports signData which lets the user sign some arbitrary data with their private key. Your backend can then take this signature and ...
Thom's user avatar
  • 354
3 votes
Accepted

Derive public key hash from bech32 address using python

Check out pycardano. Class Address has a class method from_primitive that can read and decode a bech32 address. Then you can directly read field payment_part, which is the public key hash of the ...
Jerry's user avatar
  • 403
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

Haskell + Blockfrost toolchain?

I think you want the cardano-api, part of the cardano-node repo. Most things that can be done, it can do. At the very least its the place to start. The cardano-cli provides a set of examples of how to ...
waalge's user avatar
  • 403
2 votes
Accepted

How to get UTxO transaction id using cardano-serialization-lib

In order to get transaction id using cardano-serialization-lib you should convert transaction id to bytes and convert them to hex string. Buffer.from(utxo.input().transaction_id().to_bytes()).toString(...
pyropy's user avatar
  • 641
2 votes

How to mint a NFT with a policy of Multiple key-hash with Nami Wallet and Cardano Serialization Lib

After days of searching I finally found my mistake: I was tryng to do the signing from backend, so I needed to generate the prvKey for this I followed the instructions provided in Cardano ...
Alicia Basilio's user avatar
2 votes

How to generate the address of a plutus script using Cardano Serialization Lib?

Script addresses are basically just addresses that uses the key hash instead of payment key hash, see the CIP19: Cardano Addresses. However, the cardano-serialization-lib does not support fee ...
Marek Mahut - StakeNuts's user avatar
2 votes
Accepted

NativeScript vs PlutusScript

I think NativeScript is a simple multisig scripting language while PlutusScript is a Turing complete scripting language. You can find more details and examples of NativeScript here
Archi - Pie Stake Pool's user avatar
2 votes
Accepted

cardano-serialization-lib-browser loaded as empty module in NextJS

I do not know why, but this worked for me this._wasm = await import( "../node_modules/@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib_bg" :s ES6 notation did not ...
Alicia Basilio's user avatar
2 votes
Accepted

Error submiting Smart Contract with Nami, What does this error means?

Yup, it seems like the validation for your script fails, usually, when that happens you'll get this error ValidationTagMismatch (IsValid True) (and you got it). There is probably something wrong with ...
pyropy's user avatar
  • 641
2 votes

PlutusData construction using @emurgo cardano-serialization-lib-browser

Maybe this will help, typhonjs supports creating plutusDataCbor using utility method const plutusDataBuffer = typhonjs.utils.createPlutusDataCbor({ constructor: 0, fields: [12, 12], }); const ...
Mehul Prajapati's user avatar
2 votes

Is it possible to generate all stake pool files and keys using Cardano Serialization Lib?

Check out this link about generating keys: https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-keys
Will's user avatar
  • 1,162
2 votes

Meaning of Index of Redeemer in Serialization Lib 10.4

I was digging in this topic because I struggled with some transactions. I was reading the CDLL, the serialization lib, docs, etc.. but I couldn't find anything about the meaning of this index. After ...
Juantxu's user avatar
  • 21
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

What's a Good example of Practle Serialation lib Usage

I find this react example very useful as it pretty much shows all cases you may want to use the serialization lib. https://github.com/dynamicstrategies/cardano-wallet-connector.git
Will's user avatar
  • 1,162
2 votes

How can I build a transaction to send different assets (not just ada) using Cardano Serialization Lib?

https://github.com/ozgrakkurt/cardano-mint-nft/blob/master/index.js The example above from Özgür Akkurt on GitHub demonstrates how to mint native tokens in JS, assuming you are looking for that ...
Rust_Dev's user avatar
  • 151
2 votes
Accepted

Convert Stake Key to Address

You can try with this line: wasm.StakeCredential.from_bytes( Buffer.from("98ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27", "hex") ) Alternatively, you can try using ...
Falcon Stakepool's user avatar
2 votes
Accepted

How to Securely Serialise a Plutus Smart Contract Endpoint?

before I can answer there is an important distinction that must be done on-chain code can be serialized, off-chain code stays "off the chain" so there is nothing to serialize so if you are ...
Michele Nuzzi's user avatar
2 votes
Accepted

Programmatically Send Transactions From a Wallet Using Javascript

If you already hold access to wallet private keys, you dont need to "interact" with a wallet extension, you already have all you need to derive the keys, addresses, fetch inputs from query ...
RdLrT's user avatar
  • 1,577

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