# How to sign a transaction in Rust SDK?

**URL:** <https://forum.fuel.network/t/how-to-sign-a-transaction-in-rust-sdk/3857>\
**Category:** Rust SDK\
**Created:** [December 13, 2023, 6:40pm UTC](https://forum.fuel.network/t/how-to-sign-a-transaction-in-rust-sdk/3857 "2023-12-13T18:40:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpoplavkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mpoplavkov/32/399_2.png) [@mpoplavkov](https://forum.fuel.network/u/mpoplavkov)\
**Post date:** [December 13, 2023, 6:40pm UTC](https://forum.fuel.network/t/how-to-sign-a-transaction-in-rust-sdk/3857/1 "2023-12-13T18:40:41Z")

</div>

Related to [How to build a transaction without signatures in Rust SDK?](https://forum.fuel.network/t/how-to-build-a-transaction-without-signatures-in-rust-sdk/3856).

Given an instance of Transaction, how to sign it with a private key?

> <https://github.com/FuelLabs/fuel-vm/blob/master/fuel-tx/src/transaction.rs#L87-L91>

I only see the way of signing a transaction using transaction builder, but I cannot use the builder, since I already have a built transaction.

> <https://github.com/FuelLabs/fuels-rs/blob/d809a24597af277de503abbc1afc7ca25ce31c95/packages/fuels-accounts/src/wallet.rs#L258-L260>

---

<div class="post-metadata">

**Author:** ![calldelegation](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/calldelegation/32/1484_2.png) [@calldelegation](https://forum.fuel.network/u/calldelegation)\
**Post date:** [December 23, 2023, 5:33pm UTC](https://forum.fuel.network/t/how-to-sign-a-transaction-in-rust-sdk/3857/2 "2023-12-23T17:33:08Z")

</div>

Hey @mpoplavkov `build_without_signatures` in the transaction builder is introduced in the PR here.

> <https://github.com/FuelLabs/fuels-rs/pull/1241>
>
> This PR adds the ability to build transaction without signatures. This is useful… if the user wants to estimate costs or wants to simulate the TX on a node without setting the right signatures.
> 
> Changes:
> \- Added a new method called \`build\_without\_signatures(provider: &impl DryRunner)\` to \`TransactionBuilders\`
> \- Added \`sign\_built\_transaction(...)\` to wallet
> \- \`fee\_checked\_from\_tx\` now builds without signatures which means we can use \`adjust\_for\_fee\` without signing first cc @MujkicA
> \- Added documentation
> 
> NOTE: If the user builds without signatures, it is their responsibility to sign the transaction in the right order. For example, if we have \`CoinSignedA\` then \`CoinSignedB\`, we need to sign with \`WalletA\` and then with \`WalletB\`. This comes from the fact that we need to set the witness indexes while building the transaction.
> 
> \### 
> \- \[x\] I have updated the documentation.
> \- \[x\] I have added tests that prove my fix is effective or that my feature works.
> \- \[x\] I have added necessary labels.
> \- \[x\] I have done my best to ensure that my PR adheres to \[the Fuel Labs Code Review Standards\](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
> \- \[x\] I have requested a review from the relevant team or maintainers.
