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

# Encrypted Transactions

> Explore how to create transactions that stay fully private until after execution with BITE Protocol on SKALE

Encrypted transactions are the first privacy primitive released as part of SKALE's BITE Protocol. An encrypted transaction requires NO changes to existing Solidity contracts and works on all Solidity transactions. It encrypts the input `data` and `to` address of the EVM Transaction and requires a threshold decryption operation from the majority of the SKALE Chain validators to be decrypted and executed.

<Note>
  Encrypted transactions are a great way to add an edge against MEV and help protect your onchain strategies from bad actors.
</Note>

## Integration Examples

```typescript MetaMask theme={null}
import { BITE } from '@skalenetwork/bite';

const bite = new BITE('https://your-skale-chain.skale.network');

async function sendEncryptedTransaction(to, data) {
    const tx = { to, data };
    const encryptedTx = await bite.encryptTransaction(tx);
    
    const txHash = await window.ethereum.request({
        method: 'eth_sendTransaction',
        params: [encryptedTx],
    });
    
    return txHash;
}
```

```typescript Ethers.js theme={null}
import { BITE } from '@skalenetwork/bite';
import { ethers } from 'ethers';

const bite = new BITE('https://your-skale-chain.skale.network');
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();

async function sendEncryptedERC20Transfer(tokenAddress, to, amount) {
    const iface = new ethers.Interface([
        'function transfer(address to, uint256 amount)'
    ]);
    const data = iface.encodeFunctionData('transfer', [to, amount]);
    
    const tx = { to: tokenAddress, data };
    const encryptedTx = await bite.encryptTransaction(tx);
    
    const txResponse = await signer.sendTransaction(encryptedTx);
    return txResponse.hash;
}
```

## Resources

* **Repository**: [https://github.com/skalenetwork/bite-ts](https://github.com/skalenetwork/bite-ts)
* **How BITE Works**: [How BITE Works](/developers/bite-protocol/how-bite-works)
* **Tutorial**: [Encrypted Transactions](/cookbook/privacy/encrypted-transactions)


Built with [Mintlify](https://mintlify.com).