Blockfrost/Cardano serialisation lib - Issue while signing transaction - signing key

Hi fellas, i am following this to create and submit a transaction using this (https://github.com/blockfrost/blockfrost-js/blob/master/examples/simple-transaction/src/index.ts)

But as we can see that this is basically only considering the utxos of the address 0. And it uses Address 0’s private key i guess to submit a transaction.

However there could be a case where utxos might be in some other address of the same account with same mnemonics.

So to use utxos of different addresses, i just looped through all the associated addreses which have utxos and i pushed them here in this utxo array (https://github.com/blockfrost/blockfrost-js/blob/master/examples/simple-transaction/src/index.ts#L45)

But as you can see the signing key that they are using is derived and returned over here (https://github.com/blockfrost/blockfrost-js/blob/fb9a55fee07927f8d7c8b0a5aa9efd2d3daf6c77/examples/simple-transaction/src/helpers/key.ts#L45)

And then using this key to sign transaction over here
(https://github.com/blockfrost/blockfrost-js/blob/master/examples/simple-transaction/src/helpers/signTransaction.ts)

So i wanted to know what should i pass as the sign key so that every utxo, which is from any address can be signed. Also what should be its format ?

I am getting this error when i use bipPrvKey.to_raw_key() as the sign key:

transaction submit error ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash “some _hash_here”]))))])"

Also i might not understand anything apart from blockfrost or cardano serialization library.
Open to any kind of help or suggestions .
Thanks in advance :slight_smile:

Hey,

I was wondering if you’ve made any head way on your issue?

I’m facing the same problem and also made an issue on the github here.

Thanks.

Hi @bakon11

Yes that got resolved with correct signKey.

But i am currently facing this issue : were transaction.to_bytes() defined over here (blockfrost-js/index.ts at master · blockfrost/blockfrost-js · GitHub)
return an empty array : Uint8Array(0)

It sometimes return correct Array when i run from one file, then if i call this from some other file it returns this empty Array.

The variable transaction is of class Transaction only (when i log it).

Could this be somehow related to some wasm memory buffer issue ?