> For the complete documentation index, see [llms.txt](https://yuga.gitbook.io/zkyuga-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuga.gitbook.io/zkyuga-whitepaper/developer-guide/creating-a-wallet-for-signing-and-authorization.md).

# Creating a Wallet for Signing and Authorization

## Signing Transactions with `ZkyugaClient`

In the world of blockchain, transactions require a digital signature to guarantee their legitimacy and prevent tampering. `ZkyugaClient` createWalletSigner function helps you achieve this by creating a special entity called a "wallet signer" using your private key. Think of this signer as your personal keycard, allowing you to authorize and sign various transactions securely.

### Understanding Signers?

On a blockchain, a signer acts like a gatekeeper. It possesses a unique digital key (private key) that creates special codes (signatures) to verify your identity during transactions. This ensures that only you, the rightful owner, can approve actions using your blockchain account.

### Method Signature

```javascript
createWalletSigner(pvtKey: string): WalletSigner
```

#### Parameters

| Parameter | Type   | Description                                                                                                                                                       |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pvtKey    | string | The user's private key string. This is an essential and sensitive piece of information that proves the ownership of an Ethereum address and its associated funds. |

#### Returns

* A `WalletSigner` instance that can be utilized to sign transactions or interact with Ethereum contracts.

### Usage Example

Import the library `ZkyugaClient`:

```javascript
import { ZkyugaClient } from "@zkyuga/zkyuga.js";
const ZkyugaClient = new ZkyugaClient();
```

Use the `createWalletSigner` method to generate a wallet signer:

```javascript
const privateKey = "your actual private key here"; // Always handle with care!
const signer = zkyugaClient.createWalletSigner(privateKey);
```

Now you have a `signer` object that you can use to sign transactions and interact with blockchain contracts.

### Remember: Security First!

1. **Guarding Your Private Key**: Treat your private key like your bank account PIN. Sharing it or storing it carelessly can result in stolen funds or unauthorized actions. Avoid embedding it directly in code, especially in publicly accessible applications.
2. **Secure Storage**: For deployed applications, consider storing your private key as an environment variable or utilizing secure vault services. This significantly reduces the chance of exposure.
3. **Transaction Fees and Limits**: Be mindful of potential rate limits when conducting numerous transactions. Remember, blockchain transactions often require gas (fees) on the network. Ensure your associated account has sufficient ETH to cover these costs.
4. **Testing Before Deployment**: Always thoroughly test your operations in a test environment before transitioning to a real-world setting. This safeguards your actual funds from any unforeseen issues.

***
