Closed iftieaq closed 1 year ago
Hi @iftieaq , sorry for long answer. Did you manage your issue ?
You can normally include all kinds of keys in transactions, but they are not required. Also, HW-Wallets will not sign a random transaction with the stake secret key if there is no need for.
Hi @iftieaq , sorry for long answer. Did you manage your issue ?
Yes, I did. It seems CSL has a helper function called add_required_signer
that enforces a signature from any stake or wallet address as required.
txBuilder.add_required_signer(BaseAddress.from_address(Address.from_bech32('addr_....)).stake_cred().to_keyhash())
Thanks @iftieaq ! But I recommend to consider @gitmachtl comment. Because when you sign a tx you can check the tx body and after you signature no one can change the tx body and output addresses too otherwise tx will be invalid.
Hi,
I was just wondering, is it possible to build a transaction with Cardano Serialization Lib where both payment and stake key will be required without involving any staking operation such as delegating a pool? I need this to prevent the Franken address attack.
Usually, when a build a simple transaction such as making a payment, the transaction usually requires the buyer's payment key. Here is an example transaction I made with Cardano Serialization Lib.
But this transaction is prone to Franken address attack as it only requires payment key. How do I build a transaction that will require both payment and staking signature from the user?