Hi @yoji , first and foremost thanks once again for your help regarding this issue.
We’ve come to the end of the road, and there’s only 1 issue currently in the way of us confirming our POC of Raw Signing for CNTs, and I was wondering if you could maybe help me out.
Based on the code you’ve recommended (the example for staking ADA), as well as the PyCardano library and their documentation, I was able to construct a transaction that sends some ADA, as well some of my own CNT from my Fireblocks Sandbox address, to an address of my Yoroi wallet.
However, when trying to submit the transaction, we’ve received an error from Blockfrost that says that the witness information (the key and signature we’ve received from Fireblocks’ Raw Signing API) wasn’t what was expected.
sig_res = self.__wait_for_transaction_confirmation(tx_res['id'])
pub_key = sig_res['signedMessages'][0]['publicKey']
sig = sig_res['signedMessages'][0]['signature']['fullSig']
witness = CardanoWitness(bytearray.fromhex(pub_key), bytearray.fromhex(sig))
return witness
This is the part from the staking example which creates a witness based on the information received from Raw Signing API. Later on, when embedding that signature into the transaction, I’ve used the PyCardano library:
@staticmethod
def __embed_signatures_in_tx(deserialized_tx_payload: dict, signature: CardanoWitness) -> bytes:
vkey = VerificationKey(signature.pub_key)
vkey_witness = VerificationKeyWitness(
vkey=vkey,
signature=bytes(signature.signature)
)
witness_set = TransactionWitnessSet(
vkey_witnesses=[vkey_witness]
)
tx_body = TransactionBody.from_primitive(deserialized_tx_payload)
transaction = Transaction(
tx_body,
witness_set
)
return transaction.to_cbor()
However in the end we submit the transaction that has the signatures embedded, we receive this error:
Tx submission res 400:b’{“error”:“Bad Request”,“message”:“{\“contents\”:{\“contents\”:{\“contents\”:{\“era\”:\“ShelleyBasedEraBabbage\”,\“error\”:[{\“contents\”:{\“contents\”:{\“contents\”:{\“contents\”:[\“VKey (VerKeyEd25519DSIGN \\\“9b4e380a414d16ced14e9cc00b6fd63ff3a22d5648a2f4a320aae0d6833920a3\\\”)\”],\“tag\”:\“InvalidWitnessesUTXOW\”},\“tag\”:\“ShelleyInAlonzoUtxowPredFailure\”},\“tag\”:\“AlonzoInBabbageUtxowPredFailure\”},\“tag\”:\“UtxowFailure\”}],\“kind\”:\“ShelleyTxValidationError\”},\“tag\”:\“TxValidationErrorInCardanoMode\”},\“tag\”:\“TxCmdTxSubmitValidationError\”},\“tag\”:\“TxSubmitFail\”}”,“status_code”:400}’
I know it’s a wall of text, but I’ve tried to go a bit in detail. Can you maybe spot what’s wrong? Are we using the Fireblocks signature in an incorrect way? Can the Fireblocks signature even work with the PyCardano TransactionWitnessSet and their VerificationKey?
As always, any information and insight is very appreciated.
Have a nice day!