Skip to main content
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
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
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

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

Signing a Tx with Nami wallet

the problem is that a raw transaction from the cardano-cli does actually not conform with the specs. Nami uses the serialization-lib in the back and this one can't recognize the cbor from the cli. A ...
Alessandro Konrad's user avatar
4 votes
Accepted

Signing a Tx with Nami wallet

If you want to load transaction to cardano-serialization-lib generated by cardano-cli you'd first have to sign it with some "dummy" signature keys and then take cbor produced by the cardano-...
pyropy's user avatar
  • 641
4 votes
Accepted

Nami wallet API implementation example for web app

The best resource I am aware of for you to get started integrating with Nami wallet is this repository: https://github.com/dynamicstrategies/cardano-wallet-connector The sample (available via a Live ...
spirois's user avatar
  • 141
3 votes

Nami getBalance() returns wrong value compared to GUI Wallet

In Nami Wallet GUI you can see the amount of ADA excluding the ADA locked with assets (in your case it is 1.37928 ADA). You can see the "Locked with assets" amount in the hint ⓘ to the right ...
Garegin S's user avatar
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,576
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

Can a smart contract create a transaction on someone else's behalf?

No, if you dont sign the transaction nobody can spend any of the UTXO in your adress... if the Nami wallet ask you to do it and you trust the page and sign some tx done by a bad behaved the web-app ...
Alicia Basilio's user avatar
3 votes
Accepted

How to verify a user owns an NFT?

This depends a bit on your use case. If you just want to look it up on the blockchain: You can query the node with cardano-cli query utxo --mainnet --address <address-to-check>. This gives you ...
Flippy's user avatar
  • 83
3 votes

Funds not appearing in wallets for highly separate generated addresses

Cardano addresses use the BIP-32 standard for key derivation. This allows a very large (2^31-1) number of addresses to be created per account index, per master seed. Being that most computers running ...
zhekson's user avatar
  • 3,689
3 votes
Accepted

Is it possible to send funds to a scriptAddress using a lightweight wallet?

This answer will surely age fast. At the time of writing both Nami V3.2.0 and Yoroi Nightly 4.11.501 allow you send to script address, but neither advertise any options of setting datums. Nami allows ...
waalge's user avatar
  • 403
2 votes

How to verify a user owns an NFT?

The blockchain stores the proof that a particular NFT belongs to a wallet. Whoever controls the wallet own the NFT. Wallet control is determined by access to its private key(signing key). If someone ...
raghu's user avatar
  • 1,834
2 votes
Accepted

How would one go about Gating content through ownership of an NFT?

In the Nami wallet documentation, it says how to interact with the wallet using web-browser, for example you can run window.cardano.enable(), there is a command for queryng UTXOs.. i have not been ...
Alicia Basilio's user avatar
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
Accepted

Difference betwen collectibles items and Assets in Nami Wallet?

This looks to be the correct behavior - nfts are often considered to be collectible items and used in that way. I've found this in nami wallet, it's looking for an nft metadata attached to the asset, ...
andycandy's user avatar
  • 321
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

What is the best approach to implement Nami Wallet. Can some provide a boiler plate or any kind of documentation.?

Here is an open-source starter project: https://github.com/cheffNFT/namiwallettemplate
base2c's user avatar
  • 66
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

How do I create and submit a transaction using only Nami Wallet?

If you are open to integrating with a wallet other than Nami, then Typhon Wallet integration is seamless which does not require you to fetch UTXOs and manually build a transaction. The below snippet ...
Mehul Prajapati's user avatar
2 votes

How do I create and submit a transaction using only Nami Wallet?

On Cardano, a transaction consists of UTxOs spent and UTxOs produced. The Nami wallet has a function to extract its UTxOs: cardano.getUtxos(amount?: Value, paginate?: {page: number, limit: number}) : [...
Jey's user avatar
  • 1,549
2 votes

Tx signed by Nami Wallet returning InvalidWitnessesUTXOW in CLI

I also struggled getting this to work via the cli. I went with a solution using the Java cardano-client-lib on the backend to create the base tx, and the cardano-serialization-lib browser package in ...
base2c's user avatar
  • 66
2 votes
Accepted

Cardano address chaos

A. The "last address" and "base address" described above are the exact same data in different representations. What you're calling the "base address" is the hex ...
Samuel Leathers's user avatar
2 votes
Accepted

Nami wallet address format to addr_test1 format

Also you can use Cardano Serialization Lib https://github.com/Emurgo/cardano-serialization-lib with the class Adress and the method Address.toBech32() : let HexAddress = "...
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
Accepted

Can there be two identical secret seed phrase generated?

The literal answer to your question is yes, the practical answer is no. Key-derivation is an entirely offline process. CIP-3 talks about how it is currently implemented in cardano (used by all ...
zhekson's user avatar
  • 3,689
2 votes

Error loading cardano-serialization-lib

I found that using WASM comes with a lot of headaches ... There is a non-wasm version of the same lib which I have installed and have been using. Here is my github repo with an example: https://github....
D S's user avatar
  • 322
2 votes

Dapp connection with mobile browser

Look in the window object for window.cardano and then look for the property yoroi and then you can interact with the public API. To enable the wallet use window.cardano.yoroi.enable(). This will ...
Traka Dev's user avatar

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