Replies: 1 comment
-
There is a constructor in account level which takes an account level private key which is usually 96 bytes (includes prv key, chain code, pub key). You can use it to create an account object. Here's a testcase for the same
Address Gen and Signing using verification key and secret key I don't think you can use a payment.vkey or payment.skey directly in Account class. But you can easily generate a payment address from a verification key and similarly sign a transaction using skey. To generate the payment address from vkey, create a VerificationKey instance with cborhex or just deserialize the json in payment.vkey file.
Similarly, to sign a transaction with payment.skey, there is a signer helper method.
The above code snippet is using composable functions to build txn. But if you are using low level transaction api / high level txn, you can directly use TransactionSigner.sign() to sign the transasction with a SecretKey. But the recommended way is to use composable functions. :) |
Beta Was this translation helpful? Give feedback.
-
Using the command
cardano-cli address key-gen --verification-key-file payment.vkey --signing-key-file payment.skey
Is it possible to construct an Account object from the 68 byte cborhex value in the .skey file?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions