7
votes
Accepted
How to decode cbor which is generated with cardano-cli build command?
Been thinking about this question for a while. I haven't yet found a way to decode the specific 57 byte cbor to an addr-style address, but I suspect it will involve using the above keymappings in some ...
3
votes
Programmatically creating the policyid / scripthash in Javascript (Browser)
Finally got my head around this, thanks to this version in Python: Re-Implementing Policy Hashing in Python by @tycl.
Basically we need to
Parse the policy (JSON)
Follow the CDDL specifications to ...
2
votes
Accepted
Re-Implementing Policy Hashing in Python
It seems I was close, but the str.encode() function was not the correct one to use.
Also a zero byte needs to be prepended to the data to be hashed. Thanks to user bwbush from the cardano forum for ...
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
Cbor address to bech32 type address in JS or python
You can also use typhonjs used by typhonwallet. It's a Pure JS library not dependent on WASM.
Install
npm i @stricahq/typhonjs
Usage
const typhonjs = require("@stricahq/typhonjs");
const ...
1
vote
Can someone show me how to get the transaction in the proper format for cip-30?
You were on the right track, the key is to add --cddl-format to the build command
1
vote
Cbor address to bech32 type address in JS or python
First install the npm module:
npm i @emurgo/cardano-serialization-lib-browser
Then you need a wasm loader module
class wasm {
async load() {
if (this._wasm) return;
/**
* @private
...
1
vote
cbor encode and decode
I use python cbor2 library or https://cbor.me. In the case of a wallet vkey, it's just a hex value that it'll decode as. Something like a transaction will have more data types embedded in the CBOR.
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 ...
1
vote
Accepted
Programmatically creating the policyid / scripthash in Javascript (Browser)
You can do this using the 10.0 beta version of cardano-serialization-lib which should make it into stable pretty soon (I'm in the process of testing this, you can follow the status on this Github ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cbor × 18cardano-cli × 6
transaction × 5
smart-contract × 3
javascript × 3
nami-wallet × 3
cardano-serialization-lib × 3
python × 2
script × 2
policy × 2
blake2b × 2
on-chain × 2
decode × 2
cip30 × 2
plutus × 1
wallet × 1
api × 1
ledger × 1
ed25519 × 1
nami × 1
hash × 1
cip × 1
aiken × 1