Comments (9)
I just pushed a fix to this issue to main branch: cffls@aae9ccc
The commit enabled users to load and use an extended signing key generated by cardano-cli
.
The usage of extended keys will be the same as non-extended keys. Something looks like this:
from pycardano import *
extended_payment_skey = PaymentExtendedSigningKey.load("path/to/extended.skey")
extended_payment_vkey = PaymentExtendedVerificationKey.from_signing_key(
extended_payment_skey
)
...
tx_body = build your transaction here
...
extended_payment_signature = extended_payment_skey.sign(tx_body.hash())
vk_witnesses = [VerificationKeyWitness(extended_payment_vkey, extended_payment_signature)]
signed_tx = Transaction(
tx_body,
TransactionWitnessSet(vkey_witnesses=vk_witnesses)
)
Please be aware that, although the library now supports loading extended keys, it does not support extended key generation, which will be added in the future. It means you will still need to use cardano-cli
to generate your extended keys at the moment.
from pycardano.
Hi,
If you use official cardano-wallet CLI to generate signing and verification keys from mnemonics (codes are below --1
), it creates keys that root private and public keys (signing and verification respectively, codes --2
). Then you create account private and public keys which are also signing and verification keys. Then you have to create a payment signing key and verification key (skey and vkey files, codes --3
). However, the type of created keys is Extended which is a different standard. You can convert extended verification keys to standard ones via codes --4
, but signing keys which are used to create a Payment address, cannot convert to non-extended format. The type of pycardano
required signing key which is used to create address value and sign the transaction is the non-extended format. So, I cannot use my seed phrases (mnemonics) with pycardano
at this time. The devs said that they will implement HD wallet support.
# --1
# Root Private Key
cardano-wallet key from-recovery-phrase Shelley < mnemonics.prv > root.prv
# Root Public Key
cardano-address key public --with-chain-code < root.prv > root.pub
# --2
# Account Private and Public Keys
cat keys/$wallet_name/root.prv \
| cardano-wallet key child 1852H/1815H/0H/0/0 \
| tee keys/$wallet_name/address.prv \
| cardano-wallet key public --with-chain-code > keys/$wallet_name/address.pub
# --3
cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file address.prv --out-file payment.skey
cardano-cli key verification-key --signing-key-file payment.skey --verification-key-file payment.vkey
# --4
cardano-cli key non-extended-key --extended-verification-key-file payment.vkey --verification-key-file non_extended_payment.vkey
from pycardano.
Hi,
After some research, I decided to generate new keys to create new wallet. Thanks for your fast reply. I'm looking forward to hearing good news :)
from pycardano.
My main focus is to make a transaction from my wallet. I used the recovery phrase to generate keys. However, if I use the recovery phrase, my signing keys are generated in the extended version. In contrast, I can generate standard version of signing key but this time I cannot restore my wallet in any application like ccvault or nami.
from pycardano.
Hi,
Thanks for posting this question! Currently, the library is unable to support hierarchical deterministic (HD) wallet or extended key, but it is in the roadmap. I labeled this issue as a feature request and will update it as soon as we start working on HD wallet and extended keys.
Meanwhile, maybe you can create a separate non-extended key, transfer some ADA to it, and do whatever you want with the library (if this is permitted by your use case)?
from pycardano.
Hello there,
I get that we can create a wallet through cardano-cli
, resulting in some private and public key.
Still in my case at some point I really need to use a cardano-wallet
wallet (using the famous 24 words, do not care it is nami, cardano-wallet or daedalus - still prefer to use directly the cardano-wallet
directly).
So are you saying guys that it is not possible to convert from one to another (I really do not care which should be the first to be created) and still be able to use pycardano? I tried too but still fall into extended key like you but I might be missing something.
Thxs.
from pycardano.
Understood, I think I will have to use an in middle non extended wallet for the time being.
from pycardano.
Great news, great job. I'm thrilled to try the new feature.
from pycardano.
Thanks @miracatici. Closing this issue as the feature had been published to v0.2.0.
from pycardano.
Related Issues (20)
- PlutusData parsing does not handle modern type hints HOT 8
- Support for CIP14
- Fee off by 1 HOT 3
- tx sign fails without giving any explicit error. Error type: 500 HOT 2
- most basic nft minting is now failing HOT 9
- Support for Ogmios 6.x in the ChainContext HOT 3
- Seperating primitives and chain contexts / higher level tooling HOT 1
- TransactionFailedException with empty websocket response / receiving empty string
- Reconstructing Transactions from CBOR does not preserve the structure HOT 7
- Support Conway HF ledger changes HOT 1
- Integration test for Conway HF
- Usage of PlutusData for Datum deserialization is unclear HOT 9
- Pycardano does not prevent adding datums for script inputs with inline datums
- Round trip plutus datum serialization/deserialization error HOT 4
- Creating an invalid tx when trying to mint too large amount of tokens HOT 5
- Error message misleading when execution/mem cost largely exceeds allowed cost
- TypeError when computing tx id: Field 'datum' should be of type typing.Union[...] HOT 1
- PyCardano creates an imbalanced transaction in complex transactions HOT 1
- [bug]: BlockFrostChainContext is not correctly initialized HOT 3
- cardano-cli context incorrect handling latest protocol params
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycardano.