API Documentation
Complete reference for integrating with Floating Point Protocol
Quick Start
Install the FPP SDK:
npm install @fpp/sdk
Initialize the client:
import { FPPClient } from '@fpp/sdk'
const client = new FPPClient({
network: 'ethereum',
rpcUrl: 'https://mainnet.infura.io/v3/YOUR_KEY'
})Core Methods
deposit(amount)Promise<FloatingPoint[]>Deposit USDT to mint Floating Points
transfer(points, recipient)Promise<TxReceipt>Private transfer using ZK proofs
withdraw(points)Promise<TxReceipt>Burn points and redeem USDT
getBalance()Promise<FloatingPoint[]>Get user's Floating Point balance
generateProof(points)Promise<ZKProof>Generate ZK proof for transaction
Smart Contract Interface
interface IFloatingPointProtocol {
function deposit(uint256 amount, bytes32 commitment) external;
function privacyPayment(
bytes32[] calldata inputNullifiers,
bytes32[] calldata outputCommitments,
bytes calldata zkProof,
bytes calldata ringSignature
) external;
function requestWithdrawal(bytes32 nullifier, bytes calldata proof) external;
function completeWithdrawal(uint256 withdrawalId) external;
}Security Considerations
- •Never expose private keys or nullifier secrets client-side
- •Always verify ZK proofs before broadcasting transactions
- •Use secure random number generation for commitments
- •Ring size should be at least 8 for adequate anonymity