Getting Started
This guide walks you through setting up the Veil smart contract and TypeScript SDK in a local development environment.
Veil is live on Stellar mainnet — the factory CCZ3JLRESNLDADGXWNEH4YQ4NXUUAHRJNCWZHYG6QB4KTDYHOH6OQ7BK is deployed and source-verified (see the introduction for on-chain receipts). Develop against Testnet, then point at Mainnet for production; the network guide covers the differences, including the paid-RPC proxy mainnet requires.
Prerequisites
- Rust with
wasm32-unknown-unknowntarget - Stellar CLI
- Node.js 18+ and npm
- A browser with WebAuthn support (Chrome 67+, Firefox 60+, Safari 14+)
Installation
Install Rust WASM target
rustup target add wasm32-unknown-unknownClone the repository
git clone https://github.com/Miracle656/veil.git
cd invisible_walletBuild the contract
cd contracts/invisible_wallet
cargo build --target wasm32-unknown-unknown --releaseOutput: target/wasm32-unknown-unknown/release/invisible_wallet.wasm
Install the SDK
cd ../../sdk
npm install
npm run buildRun contract unit tests
cd contracts/invisible_wallet
cargo testExpected output — 6 passing tests:
test test_init_registers_signer ... ok
test test_init_twice_fails ... ok
test test_verify_webauthn_valid ... ok
test test_verify_webauthn_wrong_key_fails ... ok
test test_verify_webauthn_wrong_challenge_fails ... ok
test test_verify_webauthn_tampered_authdata_fails ... okSDK Usage
React — useInvisibleWallet hook
import { useInvisibleWallet } from 'invisible-wallet-sdk'
export default function WalletDemo() {
const { address, isPending, error, register, signAuthEntry, login } =
useInvisibleWallet('FACTORY_CONTRACT_ADDRESS')
return (
<div>
{address ? (
<p>Wallet: {address}</p>
) : (
<button onClick={() => register('alice')} disabled={isPending}>
{isPending ? 'Creating...' : 'Create Wallet'}
</button>
)}
</div>
)
}Vue 3 — useInvisibleWallet composable
<script setup lang="ts">
import { useInvisibleWallet } from 'invisible-wallet-sdk/vue'
const { address, isPending, error, register, signAuthEntry, login } =
useInvisibleWallet({
factoryAddress: 'FACTORY_CONTRACT_ADDRESS',
rpcUrl: 'https://soroban-testnet.stellar.org',
networkPassphrase: 'Test SDF Network ; September 2015',
})
</script>
<template>
<p v-if="address">Wallet: {{ address }}</p>
<button v-else :disabled="isPending" @click="register('alice')">
{{ isPending ? 'Creating...' : 'Create Wallet' }}
</button>
</template>Both adapters wrap the same framework-agnostic core, so they expose the same actions — only the state differs (React state vs. Vue refs). vue is an optional peer dependency, and neither entry point pulls in the other’s framework.
Signing a Soroban auth entry
// signaturePayload is the 32-byte Soroban HashIdPreimage
const sig = await signAuthEntry(signaturePayload)
if (sig) {
// sig = { publicKey, authData, clientDataJSON, signature }
console.log('Public key:', sig.publicKey)
console.log('Signature (r||s):', sig.signature)
}signAuthEntry triggers a native biometric prompt on the user’s device. The signaturePayload is used as the WebAuthn challenge, cryptographically binding the assertion to that specific transaction.
Environment Setup
Local Stellar node
docker run --rm -it \
-p 8000:8000 \
--name stellar \
stellar/quickstart:latest \
--local \
--enable-soroban-rpcRPC URL: http://localhost:8000/soroban/rpc
Testnet
- RPC:
https://soroban-testnet.stellar.org - Network passphrase:
Test SDF Network ; September 2015 - Friendbot:
https://friendbot.stellar.org/?addr=<your_address>
Mainnet
Veil runs on mainnet today. Unlike testnet, there is no public Soroban RPC — the wallet reaches a paid provider through a server-side proxy, so the RPC URL is never shipped to the browser.
- Factory contract:
CCZ3JLRESNLDADGXWNEH4YQ4NXUUAHRJNCWZHYG6QB4KTDYHOH6OQ7BK - Horizon:
https://horizon.stellar.org - Network passphrase:
Public Global Stellar Network ; September 2015 - Soroban RPC: a paid/keyed provider set in the server-only
MAINNET_RPC_URL(no Friendbot — buy XLM from an exchange)
See Choosing a Network → Mainnet RPC is paid for providers and the proxy pattern.
Next Steps
- Architecture — understand the full WebAuthn verification pipeline
- Contract API — all public contract functions and types
- SDK Reference — complete SDK function signatures