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 ...
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 ...
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 ...
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() && ...
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: ...
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 = ...
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 ...
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 ...
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,...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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(...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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
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 ...
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": &...
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
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cardano-serialization-lib × 109cardano-cli × 18
nami-wallet × 17
wallet × 14
transaction × 14
plutus × 12
smart-contract × 11
nft × 10
utxo × 10
cardano-address × 9
cardano-node × 6
blockfrost × 6
stake-pool × 5
staking × 4
native-assets × 4
javascript × 4
emurgo × 4
datum × 4
address × 3
cbor × 3
cardano-graphql × 3
private-key × 3
public-key × 3
hash × 3
api × 2