How to get transaction digest with tx_bytes and signature data?

Hello. I’m using the Sui RPC unsafe_payallsui to build the tx bytes, and signing offline. Then I have the pre-sign tx bytes and the signature data. My question is how can I get the transaction digest with these data?

For example, here is the data:

 %{
      "signatures" => [
        "ACsdUhoGnKPX6vCwg2snkKoPtHHDU3Vz4AId7FBKjDr0pMQLBR1MjqJ3PZISpCQIlC5BfBo+/7lY1sfIzsUDBgDLwM84jKi1T1jFXHrNAdHIYJKqWuzFgBXR3IfYMnmg7w=="
      ],
      "tx_bytes" =>
        "AAACAAggxMcTLAAAAAAgg7bF+MvA5HLpkY933tpPcUla8S/m0RWKdR+XktlujQ8CAgABAQAAAQEDAAAAAAEBAMZACk2KlfimV6aRkKjqCUBjJiMgjceCMMBh+3gapTOOAY4KNVjfSMQyOrwYfhJcB1mzKDh36oXjdbKvQMBLf0NT2km8BAAAAAAgi/2KrppX5EOILrbW9U4unnpdOdUGE0rQDku9BUO8IFLGQApNipX4plemkZCo6glAYyYjII3HgjDAYft4GqUzju4CAAAAAAAAABJ6AAAAAAAA"
    }

I tried toB58(blake2_hash("TransactionData::" ++ base64_decode(tx_byes))) , the result is close but not correct. Does it need using the signature data or other things? Thanks.

1 Like