Hot answers tagged

5 votes

How do I properly derive a stake key from an address using Bech32?

Credit to someone on Reddit who helped me with this: Deriving the staking address requires you to manually update the header byte before bech32 encoding the hex account. All I needed to do was add e1 ...
ImminentFate's user avatar
5 votes
Accepted

Is there a Python Version of Cardano Node-CLI JavaScript Library?

I know you are asking for a python library interacting with a node, but let me tell you there is a very comprehensive python library with which you don't need to run a node yourself. You can find a ...
LACE pool's user avatar
  • 619
4 votes
Accepted

Encoding / Decoding Fingerprint with Python

By last part I assume you mean just the bech32.sh. If so, you can use the below : encodedstr=bech32.bech32_encode("prefix",bech32.convertbits(bytes.fromhex(hexstr), 8, 5))
RdLrT's user avatar
  • 1,567
3 votes
Accepted

Inconsistent script addresses built with cardano-cli vs. PyCardano

After a quick look at the PyCardano implementation of script_hash the problem is in the input of the function. The hash of a Plutus script is calculated using the compiled contract wrapped only once ...
Michele Nuzzi's user avatar
3 votes
Accepted

bech32 in Shelley addresses

The problem stems from bech32 being a base5 encoding, which means that one character of address representation encodes only 5 bits of the actual address data. The bech32_decode function from Python ...
emesik's user avatar
  • 866
3 votes

bech32 in Shelley addresses

I would use the bech32 decoder tool available here: https://github.com/input-output-hk/bech32 You can also find it in Daedalus in the binaries folder for your platform. $ bech32 <<< ...
Andrew Westberg - BCSH's user avatar
3 votes

Python equivalent to Ogmios?

https://pypi.org/project/pycardano/ I think this is as close as it gets with Python so far...
Rust_Dev's user avatar
  • 151
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
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 ...
Pavan Vora's user avatar
2 votes
Accepted

Serialize a transaction in python

Good news, there is a python implementation available! https://github.com/cffls/pycardano I haven't used it myself but the Readme claims this library is able to build and sign transactions. It even ...
LACE pool's user avatar
  • 619
2 votes

Whats the python script to check if an cardano address has a script flag?

PyCardano can help you to find the address type. For example, addr1wyzynye0nksztrfzpsulsq7whr3vgh7uvp0gm4p0x42ckkqqq6kxq is the script address of Spacebudz. You can decode it into an Address object ...
Jerry's user avatar
  • 403
2 votes
Accepted

How to specify the Cardano address for BlockFrost Transaction Endpoint?

Going by your question I will assume you are trying to get the transaction history of your wallet? The endpoint you are using requires an address previously associated with a transaction, and an ...
keefie's user avatar
  • 431
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 ...
tycl's user avatar
  • 190
1 vote

pycardano library seed phrase

You can take a look at this function that I am using to work with Hierarchical Deterministic Wallets in PyCardano. If the mnemonic file does not exist, it generates a new one and saves it to disk, and ...
George - APEX Stake Pool's user avatar
1 vote

Get Transaction History Given Policy ID using Blockfrost API

Unfortunately Blockfrost currently requires the concatenated policy and asset name to query asset transactions but you can use the Koios API instead with just the policyId since the asset name is ...
keefie's user avatar
  • 431
1 vote
Accepted

Trying to submit a minting transaction using pycardano and blockfrost

The problem is the NFT's native script is missing from the transaction. See this line in the transaction repl: 'native_scripts': None, Not sure how this transaction was build, but looks like you have ...
Jerry's user avatar
  • 403
1 vote

How Can I Collect Pool Operator Submit APIs?

Unfortunately, there's no such way to do that. Anyone running cardano-node can also run cardano-submit-api and expose it for you to send transactions. This means that not only SPOs can do it, so I ...
Falcon Stakepool's user avatar
1 vote
Accepted

Python equivalent to Ogmios?

I just put this library together as I needed to access Ogmios from a Python application. It is still a work in progress, but it is working. https://pypi.org/project/pyogmios/
King Leon's user avatar
  • 136
1 vote

How do I properly derive a stake key from an address using Bech32?

Maybe it is a bit late, but hope it helps. You can use this python library PyCardano to derive the stake key. Here is the code example: >>> from pycardano import Address, Network >>>...
Jerry's user avatar
  • 403
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 ...
intrinsic-values's user avatar
1 vote

Similar source for Cardano

Cardano uses Bip32-Ed25519 standard for deriving keys and uses bech32 for encoding keys/addresses. I'm not aware of any native python libraries for doing the key derivation, but you could wrap cardano-...
Samuel Leathers's user avatar
1 vote

How to derive addresses from a key exported from Yoroi

I would suggest you leave Yoroi out of it. You have a seed phrase that can generate your wallet private keys. So, use the cardano-wallet tools to generate your keys, derive addressed, etc. You can do ...
nalyd88's user avatar
  • 1,742

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