Comments (6)
@faustbrian Why did you stike-through your text? What solution did you find?
I still cannot find a method to convert the result of privateKey.to_bech32()
back to a PrivateKey
. The generating transactions example also shows the use of CardanoWasm.PrivateKey.from_bech32
which is undefined...
The code you showed converts from a BIP39 seed and not a bech32 private key like ed25519e_sk16rl5f...
, so I'm confused.
from cardano-serialization-lib.
Shelley addresses (usually BaseAddress
witnesses are created using make_vkey_witness
(
cardano-serialization-lib/rust/src/utils.rs
Line 530 in 15d193f
And yes, all of Shelley (and every other hardfork) is supported.
You can find example code here (but this example code hasn't been updated for Mary yet) https://github.com/Emurgo/cardano-serialization-lib/blob/59426b43d105e6cf4f05e4b5945c0cb3dc483130/doc/getting-started/generating-transactions.md#example-code
Feel free to re-open the issue if you think this doesn't address your question.
from cardano-serialization-lib.
Thanks, that got me a bit further but the CardanoWasm.PrivateKey.from_bech32
method doesn't seem to exist anymore which is used in const prvKey = CardanoWasm.PrivateKey.from_bech32("ed25519e_sk16rl5fqqf4mg27syjzjrq8h3vq44jnnv52mvyzdttldszjj7a64xtmjwgjtfy25lu0xmv40306lj9pcqpa6slry9eh3mtlqvfjz93vuq0grl80");
.
What has this been replaced with? I assume with from_normal_bytes
and from_extended_bytes
and the Bech32 private key should be turned into an UInt[]
or are there any helper methods to turn the private key into bytes?
const privateKey = CardanoWasm.Bip32PrivateKey.from_bip39_entropy(Buffer.from(BIP39.toEntropy(mnemonic), "hex"), Buffer.from(""))
.derive(harden(Purpose.CIP1852))
.derive(harden(slip44))
.derive(harden(0))
.to_raw_key();
from cardano-serialization-lib.
@CherryDT our solution is here https://github.com/ArkEcosystem/platform-sdk/blob/master/packages/platform-sdk-ada/src/services/transaction.ts#L26-L136
from cardano-serialization-lib.
@faustbrian Thank you but I'm a bit lost, I see here only handling of derived keys. Can you point me to the exact place you are loading a string starting with ed25519e_
into a CardanoWasm.PrivateKey
object?
from cardano-serialization-lib.
@CherryDT there is no method to get a PrivateKey
struct from a bech32 string, you will need the raw bytes and then you can use from_extended_bytes()
or from_normal_bytes()
, depending on how you generated that private key.
from cardano-serialization-lib.
Related Issues (20)
- Help please? Private Keys in code?
- Help please? Private Keys in code? HOT 1
- DatumSource struct makes the script input to be reference input
- Unable to deregistration stake raw transaction HOT 2
- Finding a Go library that can perform basic data signature validation. HOT 2
- Distribute as a single NPM package HOT 1
- Make JSON encoding total & standardize it HOT 11
- RewardAddress method naming: why payment_cred() and not stake_cred()? HOT 1
- `RewardAddress`, `BaseAddress`, `EnterpriseAddress`, `PointerAddress` have no getter for network id HOT 3
- OutputDatum is not used in TransactionOutput HOT 1
- TransactionMetadatum.as_* methods: wrong type annotation HOT 1
- Fee calculation mismatch with conway certificates HOT 4
- `add_change_if_needed` multiple change outputs on many assets causes Error from node `OutputTooSmallUTxO` HOT 3
- plutus script witness deserialization issue HOT 8
- Add inputs with assets. HOT 1
- Witness Set Serialization differs between v11.5 and v12a18 HOT 3
- when a transaction has 2 inputs the fees are miscalculated, and uses 1 ADA as fee HOT 4
- Reference script to_bytes() includes tag 24 cbor wrapper HOT 9
- Hash Mismatch HOT 1
- CIP-0116 compatibility
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 cardano-serialization-lib.