7 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 ...
user avatar
6 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 ...
user avatar
  • 1,089
5 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 ...
user avatar
  • 66
4 votes

window.cardano undefined

I am using this code in react: const isBrowser = () => typeof window !== "undefined"; export const getCardano = (): Cardano | undefined => { const cardano = isBrowser() && ...
user avatar
4 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 = ...
user avatar
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 ...
user avatar
  • 371
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 ...
user avatar
  • 873
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 ...
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 ...
user avatar
  • 324
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 ...
user avatar
2 votes
Accepted

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 ...
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
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 ...
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 ...
user avatar
  • 581
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
user avatar
2 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 ...
user avatar
  • 323
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 ...
user avatar
  • 896
2 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,...
user avatar
  • 1,089
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
user avatar
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 ...
user avatar
  • 146
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 ...
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 ...
user avatar
  • 497
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": &...
user avatar
1 vote
Accepted

How to provide Datum value using serialization lib

Thanks to Sebastien, there is an open issue for this. Github Feature Request Besides, one can attach the datum separately to the tx witness set, like so for example: const datums = PlutusList.new(); ...
user avatar
1 vote

Create transaction serialization-lib > version 10

You can check the changelog here for some examples and explanations: https://github.com/Emurgo/cardano-serialization-lib/releases/tag/10.0.0 A rough example could look something like this: function ...
user avatar
  • 1,089
1 vote

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 ...
user avatar
  • 11
1 vote

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 ...
user avatar
1 vote
Accepted

How can I use cardano-serialization-lib in the browser to decode CBOR?

With the help of Samuel's answer, I have been able to get it running. Some important things I didn't know: import from CDN has to be done with the full url. The library has to be imported inside of ...
user avatar
  • 3,131
1 vote
Accepted

TransctionBuilder.new() in cardano-serialization-lib 10.0.0

You should probably now use the ConfigBuilder to create a config for creating the TransactionBuilder. This should do the trick: const cfg = TransactionBuilderConfigBuilder.new() .fee_algo(this.S....
user avatar
  • 1,089
1 vote

help, i register script policy with pool.pm was not approved?

To register a NFT's Policy script in pool.pm you will need to paste your json policy script into the NFT's script text input. The JSON file should be formatted like this: { "type": "...
user avatar

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