Skip to content

decodeVerKeyDSIGN: wrong length, expected 32 bytes but got 0 #113

Closed
@robinboening

Description

@robinboening

I am trying to make a simple transaction (lovelace only) using generated payment keys.

CHAIN_CONTEXT = BlockFrostChainContext(
  project_id=BLOCKFROST_PROJECT_ID,
  network=Network.TESTNET,
  base_url="https://cardano-preprod.blockfrost.io/api",
)

payment_key_pair = PaymentKeyPair.generate()
payment_signing_key = payment_key_pair.signing_key
payment_verification_key = payment_key_pair.verification_key

stake_key_pair = StakeKeyPair.generate()
stake_signing_key = stake_key_pair.signing_key
stake_verification_key = stake_key_pair.verification_key

address = Address(payment_part=payment_verification_key.hash(),
                         staking_part=stake_verification_key.hash(),
                         network=Network.TESTNET)

toAddress = "..."
...
builder = TransactionBuilder(CHAIN_CONTEXT)
builder.add_input_address(address)
builder.add_output(TransactionOutput.from_primitive([toAddress, 10000000]))
builder.build_and_sign([payment_signing_key], change_address=address)

The tx can be built, but submitting it to Blockfrost throws this error

blockfrost.utils.ApiError: {'error': 'Bad Request', 'message': '"transaction read error RawCborDecodeError [DecoderErrorDeserialiseFailure \\"Byron Tx\\" (DeserialiseFailure 1 \\"Size mismatch when decoding TxAux.\\\\nExpected 2, but found 4.\\"),DecoderErrorDeserialiseFailure \\"Shelley Tx\\" (DeserialiseFailure 1 \\"Size mismatch when decoding \\\\nRecord RecD.\\\\nExpected 4, but found 3.\\"),DecoderErrorDeserialiseFailure \\"Shelley Tx\\" (DeserialiseFailure 1 \\"Size mismatch when decoding \\\\nRecord RecD.\\\\nExpected 4, but found 3.\\"),DecoderErrorDeserialiseFailure \\"Shelley Tx\\" (DeserialiseFailure 1 \\"Size mismatch when decoding \\\\nRecord RecD.\\\\nExpected 4, but found 3.\\"),DecoderErrorDeserialiseFailure \\"Shelley Tx\\" (DeserialiseFailure 193 \\"decodeVerKeyDSIGN: wrong length, expected 32 bytes but got 0\\"),DecoderErrorDeserialiseFailure \\"Shelley Tx\\" (Deseria', 'status_code': 400}

I can see it hast to do with the verification key and I bet I am doing something wrong. Any idea what it is? 🙇

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions