Logo
Back to Hub

Encrypt Single Value

Demonstrate accepting single encrypted user input with proof validation

Encryption
Documentation

Encrypt Single Value

Demonstrates accepting a single encrypted user input with proof validation - the essential pattern for all FHEVM applications.

What You'll Learn

  • Using FHE.fromExternal() to validate encrypted inputs
  • Input proof binding to contract AND user address
  • Client-side encryption with fhevmjs
  • Permission management patterns (correct vs wrong)

Key Pattern

Loading...

Client-Side Usage

Loading...

Common Pitfalls

Missing permissions - User can't decrypt without FHE.allow()Wrong proof binding - Proof must match contract AND user address ❌ Wrong parameter order - Handle first, then proof

Quick Start

Loading...
Loading...