Giter Site home page Giter Site logo

Comments (9)

cffls avatar cffls commented on July 30, 2024 3

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.

miracatici avatar miracatici commented on July 30, 2024 2

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.

miracatici avatar miracatici commented on July 30, 2024 1

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.

miracatici avatar miracatici commented on July 30, 2024

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.

cffls avatar cffls commented on July 30, 2024

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.

bhoudebert avatar bhoudebert commented on July 30, 2024

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.

bhoudebert avatar bhoudebert commented on July 30, 2024

Understood, I think I will have to use an in middle non extended wallet for the time being.

from pycardano.

miracatici avatar miracatici commented on July 30, 2024

Great news, great job. I'm thrilled to try the new feature.

from pycardano.

cffls avatar cffls commented on July 30, 2024

Thanks @miracatici. Closing this issue as the feature had been published to v0.2.0.

from pycardano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.