<p>I am using the cardano-serialization-lib to derive addresses and create a transaction unsigned. I am then passing that transaction hash in CBOR to an external program to handle the signing process. I am unsure how that works because with the library, we sign the transaction by creating a new Transaction Object, passing in the witnesses and body of the previous transaction. See below</p>
<pre><code>const signed_transaction = await cardanolib.Transaction.new(
  newTx.body(),
  witnesses,
  undefined //metadata
);
</code></pre>
<p>I want to to this on my own, but I'm not sure exactly what gets signed. I have tried signing the transaction body with the curve25519 algorithm, but I am getting a different hash from that transaction made this way. I am not sure if I am understanding how the signing process works for the transaction. What exactly gets signed and how do I create that transaction?</p>

CC BY-SA 4.0
2022-07-13T19:17:28.310Z
Did you ever figure this out? Might have to go through the node source code :-/
noone392
CC BY-SA 4.0
2022-07-14T13:18:59.427Z
@noone392 yes I found a solution. it works the same way as the signing works in an all hot implementation with CSL. Ill give you a hint, there exists some function to grab the hash and you have to go about making the witnesses object yourself. Going to require you to step through the source code a bit, but nothing crazy.
Michael
<wallet><transaction><cardano-serialization-lib><cbor><ed25519>
How to sign transaction externally?
# How to sign transaction externally?

(Asked by: username_0 on 2022-03-16)

I am using the cardano-serialization-lib to derive addresses and create a transaction unsigned. I am then passing that transaction hash in CBOR to an external program to handle the signing process. I am unsure how that works because with the library, we sign the transaction by creating a new Transaction Object, passing in the witnesses and body of the previous transaction. See below
const signed_transaction = await cardanolib.Transaction.new(
  newTx.body(),
  witnesses,
  undefined //metadata
);

I want to to this on my own, but I'm not sure exactly what gets signed. I have tried signing the transaction body with the curve25519 algorithm, but I am getting a different hash from that transaction made this way. I am not sure if I am understanding how the signing process works for the transaction. What exactly gets signed and how do I create that transaction?

**Tags:** wallet, transaction, cardano-serialization-lib, cbor, ed25519
> **Comments:**
> **username_1**: Did you ever figure this out? Might have to go through the node source code :-/  
> **username_0**: @noone392 yes I found a solution. it works the same way as the signing works in an all hot implementation with CSL. Ill give you a hint, there exists some function to grab the hash and you have to go about making the witnesses object yourself. Going to require you to step through the source code a bit, but nothing crazy.  

---

## 0 answers

