Emurgo / cardano-serialization-lib

This is a library, written in Rust, for serialization & deserialization of data structures used in Cardano's Haskell implementation of Alonzo along with useful utility functions.
Other
234 stars 125 forks source link

Help please? Private Keys in code? #649

Closed viraladmin closed 8 months ago

viraladmin commented 1 year ago

I am trying to do something that should be basic.... request a payment of a specific amount from a user, then forward them to the correct page on successful payment.

I cannot figure out how to do it.

I tried pasting your example code from docs into chatGPT... and chatGPT says that the code requires I use my private keys in my JS publicly.

Specifically it is saying "const prvKey = CardanoWasm.PrivateKey.from_bech32("ed25519e_sk16rl5fqqf4mg27syjzjrq8h3vq44jnnv52mvyzdttldszjj7a64xtmjwgjtfy25lu0xmv40306lj9pcqpa6slry9eh3mtlqvfjz93vuq0grl80");"

that line from the example code on https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions

Is asking one to expose private keys.

Clearly this cannot be the case.

Are there any basic examples of requesting the visitor of a website make a payment.

lisicky commented 8 months ago

I'm not sure that chatGpt is a good expert in this area, even if it has enormous number of parameters. If you provide your private key to third party tool you need to be sure that tool doesn't send your key somewhere else. CSL doesn't send keys to somewhere and you can check it by yourself because it is an opensource library. If you publish your code with your private key to public repository or your repo is exposed in this case it is would be dangerous for you private data. Just follow the rules of digital hygiene and do not publish your private data in the public domain