Trouble signing raw Stellar transaction

I’ve been trying to figure out how to sign a raw Stellar transaction so that I can perform operations other than transfer. I used the Stellar SDK to construct a transaction and convert it to a raw XDR byte buffer. I then attempted to use createTransaction from Fireblocks SDK, but it fails with HTTP status 400 and data { message: 'Invalid message content (undefined)', code: 1409 }.

Here’s some relevant data from the request that I logged from axios. Anything seem out of place about it?

      baseURL: 'https://sandbox-api.fireblocks.io',
      method: 'post',
      url: '/v1/transactions',
      data: '{"operation":"RAW","assetId":"XLM_TEST","source":{"type":"VAULT_ACCOUNT","id":"1"},"extraParameters":{"rawMessageData":{"messages":[{"message":{"type":"Buffer","data":[0,0,0,2,0,0,0,0,205,255,172,137,212,224,162,151,101,145,13,45,90,138,50,162,37,79,36,151,81,138,157,102,153,124,108,185,130,184,194,148,59,154,202,0,0,39,4,247,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,101,124,182,23,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,205,255,172,137,212,224,162,151,101,145,13,45,90,138,50,162,37,79,36,151,81,138,157,102,153,124,108,185,130,184,194,148,0,0,0,6,0,0,0,1,85,83,68,67,0,0,0,0,165,111,150,69,109,127,131,192,125,199,218,108,156,64,141,155,243,214,75,16,177,193,35,227,80,160,51,249,2,229,173,83,1,99,69,120,93,138,0,0,0,0,0,0,0,0,0,0]}}]}}}'
    }

Hey @Colin the message you have delivered is not in the right format. You should have a hashed message, then hex it, and then send it to Fireblocks as part of the request.

I gave that a try as well, but got the same error. Pretty sure it’s because Stellar uses EdDSA instead of ECDSA (which Bitcoin uses in the documentation example). Apparently EdDSA’s signing process doesn’t require the additional hash step that ECDSA uses, but I still haven’t quite figured it out.