Skip to content

VaultCreate txn improperly serialized with MPToken Asset input #869

@ckeshava

Description

@ckeshava

The xrpl-py client library does not correctly serialize VaultCreate transaction when an MPToken is used as the Asset of the vault. The improper serialization of the fields result in a rippled error that looks in this fashion:

{'api_version': 2, 'error': 'invalidTransaction', 'error_exception': 'invalid SerialIter getBitString', 'id': 'RequestMethod.SUBMIT_381981', 'request': {'api_version': 2, 'command': 'submit', 'fail_hard': False, 'id': 'RequestMethod.SUBMIT_381981', 'tx_blob': '120041210000F7E02400000450201B000004646840000000004C4B407321ED13CC1FDE94B78FBC6840457512A7441362D311F58E4BADFF6BDF7BECEB16157E744081EFA5E2A27112AD7CB9B10EC4BAA45CCE465B1F8D3877ADF9989AC43812089155F9BAB7795E4AA8B05AA3F330468546822931DC7BDED3F5707C0A9241C1B203811499F70D70085D423EBB0F75CCA90FF117993B296903180000044F99F70D70085D423EBB0F75CCA90FF117993B2969'}, 'status': 'error', 'type': 'response'}

The input transaction (in JSON format) looks like this:

{'Account': 'rEsaLimTG68Dks7cA3UWUswNiYrDCCAcrD', 'TransactionType': 'VaultCreate', 'Fee': '5000000', 'Sequence': 1104, 'LastLedgerSequence': 1124, 'SigningPubKey': 'ED13CC1FDE94B78FBC6840457512A7441362D311F58E4BADFF6BDF7BECEB16157E', 'TxnSignature': '81EFA5E2A27112AD7CB9B10EC4BAA45CCE465B1F8D3877ADF9989AC43812089155F9BAB7795E4AA8B05AA3F330468546822931DC7BDED3F5707C0A9241C1B203', 'NetworkID': 63456, 'Asset': {'mpt_issuance_id': '0000044F99F70D70085D423EBB0F75CCA90FF117993B2969'}}

This error originates from this location inside rippled.

The client library does not serialize the transaction in a manner that is compatible with the XRPL Binary Format protocol. rippled serialized STIssue (with MPToken) in the following way:

 - 160 bits MPT issuer account
 - 160 bits black hole account
 - 32 bits sequence

xrpl-py serializes the STIssue type in a different way:

 - 160 bits MPT issuer account
 - 32 bits sequence
(a total of 192 bits)

The lack of black-hole account serialization in xrpl-py causes the mismatch in the XRPL binary format expectations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions