Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction arguments parsing issue in Aptos transaction blind signing #3899

Open
wayne-law opened this issue Jun 15, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@wayne-law
Copy link

wayne-law commented Jun 15, 2024

Describe the bug
I'm trying to use a payloadJson to do an aptos transaction blind signing, but I found that the trust core will change the arguments's value in the encoded of output, it will cause the transaction go to fail.

here is the failed tx: https://aptoscan.com/transaction/983120591#payload

To Reproduce

  1. use this payload json to do an aptos transaction blind signing
{
    "type": "entry_function_payload",
    "function": "0x111ae3e5bc816a5e63c2da97d0aa3886519e0cd5e4b046659fa35796bd11542a::router::deposit_and_stake_entry",
    "type_arguments": [],
    "arguments": [
        "20000000",
        "0xb26df6e5f2a60248ab61deff98c6c45e0e8f16fdc5fc5e417e4e4d3b447aefc3"
    ]
}

here's an exmaple to do an aptos transaction blind signing: https://github.com/trustwallet/wallet-core/blob/master/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/aptos/TestAptosSigner.kt

  1. then use the encoded of output to broadcast
  2. go to aptoscan to check the transaction's payload, the arguments 0 changes to "0x002d310100000000"

Expected behavior
Don't change the value of argument in the transaction payload's arguments when do the signing

@wayne-law wayne-law added the bug Something isn't working label Jun 15, 2024
@jianbinking
Copy link

face the same issue with the same dapp, quite amazing 🤔
https://explorer.aptoslabs.com/txn/983156702/userTxnOverview?network=mainnet

@wayne-law
Copy link
Author

wayne-law commented Jun 15, 2024

Here's another failed tx: https://explorer.aptoslabs.com/txn/0x154cea3fe33ca021694fb1b8c0ae6ef80ab3e2df761a7041124fa48fbd239dc2/payload?network=mainnet

the raw payload is

{
    "type": "entry_function_payload",
    "function": "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3::controller::deposit",
    "type_arguments": [
        "0x1::aptos_coin::AptosCoin"
    ],
    "arguments": [
        "0x4d61696e204163636f756e74",
        "10000000",
        false
    ]
}

after signed by trust core, argument 0 change to "0x00000000000000000000000000000000000000004d61696e204163636f756e74".

Here's the success one signed by martian wallet extension:
https://explorer.aptoslabs.com/txn/0x894c2e80803996523a633bbe1383e737a10fdef050f07fa201b43b9d73c824de/payload?network=mainnet

@satoshiotomakan
Copy link
Collaborator

Hi @wayne-law, could you please advise how do you broadcast the signed transaction? We do recommend to broadcast SigningOutput.json value.
Regarding 0x00000000000000000000000000000000000000004d61696e204163636f756e74 value, it seems to be the same as 0x4d61696e204163636f756e74, just displayed with a prefixed zeros that should not make any sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants