# Sign Transaction

Signing a transaction is a critical step that authorizes the movement of funds or interaction with smart contracts on the Cardano blockchain. This guide covers the primary methods for signing: on the frontend using a browser-based wallet, and on the backend using a server-side script.

## Frontend (Client-Side) Signing

Frontend signing is the most common method for user-centric applications. It leverages the user's installed browser wallet (like Eternl or Lace) to request a signature, ensuring that the user's private keys never leave their secure environment.

### Using Weld

We recommend using our [Weld](https://github.com/Cardano-Forge/weld) library to simplify interaction with browser wallets. Weld provides a unified API to connect to various wallets and request transaction signatures.

### Using the Browser Developer Console

For quick testing, you can directly use the CIP-30 wallet API exposed in the browser's developer console.

1. Go to any website with a connected Cardano wallet (e.g., `https://ada-anvil.io`).
2. Open the Developer Console.
3. Execute the following JavaScript to enable the wallet and request a signature:

   ```javascript
   // Example using Eternl wallet
   const w = await window.cardano.eternl.enable();

   // Replace with your actual transaction CBOR
   const signedTx = await w.signTx("Your unsigned transaction CBOR", true);

   console.log(signedTx);
   ```
4. Some wallets will prompt you to authorize your dApp to interact with the wallet.
5. Your wallet will then prompt you to sign the transaction.
6. The signed transaction CBOR, including the witness set, will be printed to the console.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ada-anvil.io/guides/transaction/signing-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
