> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# tx sign and tx send

> Create stellar transactions using the Stellar CLI

The previous examples of using `tx new` showed how to create transactions. However, these transactions were immediately ready to be signed and submitted to the network.

To avoid this each of the subcommands has the `--build-only` argument, which as the name suggests only builds the transaction and prints the transaction envelope.

## `tx sign`

Let's return to the first example of creating `bob`s account:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
stellar tx new create-account \
  --source alice \
  --destination bob \
  --starting-balance 100_000_000 \
  --build-only
```

would output something like:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
AAAAAgAAAADwSUp9CwmVlPN40mKX1I1j39y6DmYc36QS1aK2x6eYVQAAAGQAEcMsAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAACTMkzn1TwPo8SIhnKvnyuv9K2/aWjpX9NTYfyiA7vXaAAAAAAX14QAAAAAAAAAAAA==
```

You can inspect it with [stellar lab!](https://lab.stellar.org/xdr/view?\$=network\$id=testnet\&label=Testnet\&horizonUrl=https:////horizon-testnet.stellar.org\&rpcUrl=https:////soroban-testnet.stellar.org\&passphrase=Test%20SDF%20Network%20/;%20September%202015;\&xdr\$blob=AAAAAgAAAADwSUp9CwmVlPN40mKX1I1j39y6DmYc36QS1aK2x6eYVQAAAGQAEcMsAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAACTMkzn1TwPo8SIhnKvnyuv9K2//aWjpX9NTYfyiA7vXaAAAAAAX14QAAAAAAAAAAAA==;;) Where you can also sign and send the transaction.

However, you can also sign the transaction with the `tx sign` command. To do this you can pipe the output of the `tx new` command to the `tx sign` command:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
stellar tx new create-account \
    --source alice \
    --destination bob \
    --starting-balance 100_000_000 \
    --build-only \
  | stellar tx sign --sign-with-key alice
```

This should output something like:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
AAAAAgAAAAAebE8Ewg9uzvHRAl+UmvP0kixsyp238kkz0zOy+91FeQAAAGQAFJk4AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPpiy8qfSw4pLYG/Bav78FfrFWlte7YQfiHX41DQ+nGWAAAAAAX14QAAAAAAAAAAAfvdRXkAAABA4kjz9Yeub/IrzogjMr57U4nYwCmSJAXxIW+7Xyjan/UweIByF7uEhVS4gEl1N138uq07njVxZwRMtugWyMleCg==
```

You can again [view it in lab and see that there is now a signature attached to the transaction envelope](https://lab.stellar.org/xdr/view?\$=network\$id=testnet\&label=Testnet\&horizonUrl=https:////horizon-testnet.stellar.org\&rpcUrl=https:////soroban-testnet.stellar.org\&passphrase=Test%20SDF%20Network%20/;%20September%202015;\&xdr\$blob=AAAAAgAAAAAebE8Ewg9uzvHRAl+UmvP0kixsyp238kkz0zOy+91FeQAAAGQAFJk4AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPpiy8qfSw4pLYG//Bav78FfrFWlte7YQfiHX41DQ+nGWAAAAAAX14QAAAAAAAAAAAfvdRXkAAABA4kjz9Yeub//IrzogjMr57U4nYwCmSJAXxIW+7Xyjan//UweIByF7uEhVS4gEl1N138uq07njVxZwRMtugWyMleCg==;;).

> [!TIP]
>
> Or sign with lab! Though currently you must send it from lab and cannot return to the CLI (a work in progress!).
>
> ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
> stellar tx new create-account \
>     --source alice \
>     --destination bob \
>     --starting-balance 100_000_000 \
>     --build-only \
>   | stellar tx sign --sign-with-lab
> ```

## `tx send`

Finally, to submit the transaction to the network you can use the `tx send` command. This command will submit the transaction to the network.

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
stellar tx new create-account \
    --source alice \
    --destination bob \
    --starting-balance 100_000_000 \
    --build-only \
  | stellar tx sign --sign-with-key alice \
  | stellar tx send
```
