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

# Enhance your wallet security with Blockaid

> Learn how to integrate real-time transaction, address, token, and URL security scanning using Portal's Web SDK with Blockaid.

Portal’s Web SDK integrates with Blockaid to provide real-time security scanning for transactions, addresses, tokens, and URLs. This integration helps detect malicious activity, phishing attempts, scam tokens, and suspicious interactions before users sign or submit transactions.

## Overview

The Blockaid integration enables you to:

* **Scan transactions** before signing or submission (EVM, Solana)
* **Scan addresses** for known malicious actors or compromised contracts
* **Validate tokens** to detect scams or security risks
* **Verify URLs** to prevent phishing attacks

## Prerequisites

Before using Blockaid security scanning, ensure you have:

* A properly initialized Portal client
* Blockaid integration enabled in your Portal Dashboard (see [Blockaid Integration](../../../integrations/Security/blockaid))

## Scanning EVM Transactions

Use `scanEVMTx` to analyze Ethereum transactions before signing or broadcasting them. This method scans EVM transactions for malicious contract interactions, risky approvals, phishing attempts, and other on-chain security threats.

```typescript theme={null}
async function scanEvmTransaction(portal: Portal) {
  const response = await portal.security.blockaid.scanEVMTx({
    chain: 'eip155:11155111',
    data: {
      from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb',
      to: '0x0d524a5b52737c0a02880d5e84f7d20b8d66bfba',
      data: '0x',
      value: '0x1000000000000000',
    },
    account_address: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb',
  })

  console.log('Blockaid EVM scan response:', response)
}
```

***

## Scanning Solana Transactions

Use `scanSolanaTx` to analyze Solana transactions before signing. This method detects malicious program invocations, suspicious token movements, and other Solana-specific risks.

```typescript theme={null}
async function scanSolanaTransaction(portal: Portal) {
  const response = await portal.security.blockaid.scanSolanaTx({
    encoding: 'base58',
    chain: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
    method: 'signAndSendTransaction',
    options: ['simulation', 'validation'],
    account_address: '86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY',
    transactions: [
      'vxBNpvao9QJmLKXUThbbjRnxm3ufu4Wku97kHd5a67FDjSqeHwcPrBKTjAHp4ECr61eWwoxvUEVTuuWX65P9bCNDJrTJpX64vjdtpHA8cogA4C92Ubj813wUUA8Ey4Bvcrdj5c1bSTCnwoE8HeFYiyioRLNZTpShx8zkyzXaxkpUvPVRN26363bGvJDNSJt8bihmwAPxfrH7kSV9BvAuhRWsiuUAN4GZzyAiptknHZ1xjzrKAHz68UNJpWnYkaUThye6r3iULZUcp7baBaGAtnUmAdDMGG1UpBusWLF',
    ],
  })

  console.log('Blockaid Solana scan response:', response)
}
```

***

## Scanning Addresses

Use `scanAddress` to analyze a single address for known security risks. This method can be used for both EVM and Solana addresses and detects malicious contracts, compromised wallets, sanctioned addresses, and other flagged entities.

### EVM Address Scan

```typescript theme={null}
async function scanEvmAddress(portal: Portal) {
  const response = await portal.security.blockaid.scanAddress({
    chain: 'eip155:1',
    address: '0x31c05d73f2333b5a176cfdbb7c5ef96ec7bb04ac',
  })

  console.log('Blockaid EVM address scan response:', response)
}
```

### Solana Address Scan

```typescript theme={null}
async function scanSolanaAddress(portal: Portal) {
  const response = await portal.security.blockaid.scanAddress({
    chain: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
    address: 'BBQUMqaFELxTFh8r1xSttYMHX6ZKzLWhsmGod2vuxgEc',
  })

  console.log('Blockaid Solana address scan response:', response)
}
```

***

## Scanning Tokens

Use `scanTokens` to analyze multiple tokens in a single request for known security risks. This method detects scam tokens, honeypots, compromised contracts, and other malicious token behavior.

```typescript theme={null}
async function scanTokens(portal: Portal) {
  const response = await portal.security.blockaid.scanTokens({
    chain: 'eip155:1',
    tokens: [
      '0x66587563e933bbf3974b89156b47bb82b921eb35',
      '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
    ],
  })

  console.log('Blockaid token scan response:', response)
}
```

***

## Scanning URLs

Use `scanURL` to detect phishing sites and malicious domains before users navigate to them. This method helps protect users from social engineering attacks and malicious off-chain activity.

```typescript theme={null}
async function scanURL(portal: Portal) {
  const response = await portal.security.blockaid.scanURL({
    url: 'https://www.google.com',
  })

  console.log('Blockaid URL scan response:', response)
}
```

***

## Next Steps

* Learn about [signing transactions](./sign-a-transaction)
* Explore [transaction simulation](./simulate-a-transaction)
* Review [Portal API methods](./portal-api-methods)
* Check out the [Blockaid Integration setup](../../../integrations/Security/blockaid)
