Documentation Index
Fetch the complete documentation index at: https://yieldxyz.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When interacting with on-chain yield protocols through the Yield API, transaction integrity is critical. Even a small modification can redirect funds or trigger unintended contract calls. Shield is a lightweight validation library that lets you verify unsigned transactions from the Yield API before presenting them for signing. It’s designed to be embedded directly into your integration — giving you full control over when and how validation occurs.GitHub Repository
View source code
NPM Package
Install via npm
Key Features
Zero-trust verification
Every transaction must match a pre-audited pattern
Multi-chain support
Works across EVM, Solana, and Tron (Cosmos and other L2s coming soon)
Easy to integrate
Add one validation call before your signing logic — no extra middleware required
Clear error reporting
Immediate feedback on invalid or ambiguous transactions
Installation
Usage Example
How It Works
Shield uses pattern matching to analyze each transaction’s structure, function calls, and parameters, validating them against a verified template for the specified yield integration. If the transaction doesn’t match the safe pattern — for example, if an attacker modified a withdrawal address — Shield immediately flags it:Supported Yield Integrations
| Chain | Yield ID | Description |
|---|---|---|
| Ethereum | ethereum-eth-lido-staking | Lido ETH staking |
| Solana | solana-sol-native-multivalidator-staking | Native SOL staking |
| Tron | tron-trx-native-staking | TRX native staking |
More integrations (Cosmos, Polkadot, Bittensor, additional EVM yields) are being continuously added.
API Reference
shield.validate(request)
Validates a transaction by auto-detecting its type. Parameters:shield.isSupported(yieldId: string): boolean
Checks whether a given yield integration is supported.shield.getSupportedYieldIds(): string[]
Returns a list of all supported Yield IDs.Common Validation Errors
| Context | Error Message | Meaning |
|---|---|---|
| Solana | Transfer recipient does not match new stake account | Your SOL is being sent to a different wallet instead of the intended stake account |
| Solana | Delegate authority is not user address | Someone else would gain control over your staked SOL |
| EVM / Ethereum | Transaction not to Lido stETH contract | The transaction targets a fake contract attempting to steal your ETH |
| Pattern Detection | No matching operation pattern found | The transaction type doesn’t match any valid pattern — likely malicious or corrupted |
Decoding & Visualization
Shield allows clients to locally decode and visualize unsigned transactions before signing or broadcasting them. This feature enhances transparency and compliance by letting integrators inspect every on-chain instruction — including target addresses, function calls, and parameter values — directly on their own systems.How It Works
Retrieve transaction
Get an unsigned transaction from the Yield API (e.g.,
/v1/actions/enter or /v1/actions/exit)Why It Matters
- Transparency: Visually confirm every on-chain call before user signing
- Security: Reduces man-in-the-middle or tampering attacks by verifying locally
- Compliance: Log decoded transactions for audit trails or regulator review
- Zero Trust: Decoding occurs entirely client-side — no external API calls needed
Shield — Go Package
For institutional and high-security deployments, Shield is also available as a Go package designed for hardware-secure, compiled environments (e.g., secure enclaves, HSMs, air-gapped systems) where TypeScript cannot be executed. Shield Go provides the same validation and decoding functionality as the TypeScript package.Capability Comparison
| Capability | Shield TypeScript | Shield Go |
|---|---|---|
| Transaction validation | ✅ | ✅ |
| Local transaction decoding | ✅ | ✅ |
| Multi-chain support (EVM, Solana, Tron) | ✅ | ✅ |
| Secure enclave compatibility | ⚠️ Limited | ✅ Full |
| Embeddable in hardware / compiled binaries | ❌ | ✅ |
| CLI / SDK usage | ✅ | ✅ |
Why Shield Matters
Each API layer in a DeFi integration increases potential attack surfaces. Shield enforces a zero-trust model, guaranteeing that the transaction users sign is exactly the one intended by Yield.xyz. By validating before signing, you:- Prevent tampering and phishing attempts
- Maintain user trust through transparency
- Add structural security without sacrificing UX
Next Steps
Security Overview
Full security architecture
HyperNative
Pre-transaction simulation
Security Tiers
Deployment models
Quickstart
Integrate Shield into your app

