Skip to content

rarimo/unforgettable-sdk

Repository files navigation

Unforgettable SDK Logo

Unforgettable SDK

Secure, seedless wallet recovery for modern applications

License: MIT npm version

Documentation β€’ Website β€’ Examples β€’ Changelog


πŸ“– Overview

The Unforgettable SDK is a comprehensive, multi-platform toolkit for implementing secure, seedless wallet recovery in your applications. It enables users to recover their private keys using biometric factors (face recognition, physical objects) and traditional methods (passwords) without storing sensitive data on servers.

Key Features

✨ Seedless Recovery - No mnemonics or seed phrases to manage
πŸ” End-to-End Encryption - Client-side cryptography, zero-knowledge architecture
🎯 Multi-Factor Authentication - Combine face recognition, images, and passwords
πŸ“± Cross-Platform - TypeScript/JavaScript, iOS (Swift), Android (Kotlin), React Native
πŸš€ Easy Integration - Simple APIs, React hooks, and native SDKs
🌐 Self-Sovereign - Users control their own recovery process


πŸ“¦ Packages

The SDK is organized into platform-specific packages:

Package Platform Version Documentation
@rarimo/unforgettable-sdk TypeScript/JavaScript (Core) npm Docs
@rarimo/unforgettable-sdk-react React Components npm Docs
com.github.rarimo.unforgettable-sdk:android Android (Kotlin) JitPack Docs
UnforgettableSDK iOS (Swift) SwiftPM Docs

Package Features

Core SDK (TypeScript/JavaScript)

  • Works in browsers and Node.js environments
  • Cryptographic key generation and encryption
  • Recovery URL generation with embedded and custom parameters
  • Polling mechanism for recovery completion
  • TypeScript type definitions

React SDK

  • Pre-built QR code component (UnforgettableQrCode)
  • React hooks for recovery flow management
  • Automatic polling and state management
  • Customizable styling and error handling

Android SDK

  • Native Kotlin implementation
  • Coroutines support for async operations
  • WebView integration helpers
  • Comprehensive error types

iOS SDK

  • Native Swift implementation with Swift Package Manager
  • Async/await support
  • Combine framework integration
  • iOS 13+ support

πŸš€ Quick Start

Web/React

npm install @rarimo/unforgettable-sdk @rarimo/unforgettable-sdk-react
# or
yarn add @rarimo/unforgettable-sdk @rarimo/unforgettable-sdk-react
import UnforgettableQrCode from '@rarimo/unforgettable-sdk-react'
import { RecoveryFactor } from '@rarimo/unforgettable-sdk'

function App() {
  return (
    <UnforgettableQrCode
      mode="create"
      factors={[RecoveryFactor.Face, RecoveryFactor.Password]}
      onSuccess={(privateKey) => {
        console.log('Recovery key:', privateKey)
      }}
    />
  )
}

Android

repositories {
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    implementation("com.github.rarimo.unforgettable-sdk:android:1.0.0")
}
import com.rarimo.unforgettable.*

val sdk = UnforgettableSDK(
    UnforgettableSdkOptions(
        mode = UnforgettableMode.CREATE,
        factors = listOf(RecoveryFactor.FACE, RecoveryFactor.PASSWORD)
    )
)

val recoveryUrl = sdk.getRecoveryUrl()
val recoveredKey = sdk.getRecoveredKey() // suspending function

iOS

dependencies: [
    .package(url: "https://github.com/rarimo/unforgettable-sdk.git", from: "1.0.0")
]
import UnforgettableSDK

let sdk = try UnforgettableSDK(
    mode: .create,
    factors: [.face, .image, .password]
)

let recoveryUrl = try sdk.getRecoveryUrl()
let recoveredKey = try await sdk.getRecoveredKey()

πŸ’‘ Examples

The repository includes comprehensive examples for each platform:

Web & Mobile

Platform Description Location Live Demo
React Web app with QR code component examples/react StackBlitz
React Native iOS & Android mobile app examples/react-native -
Android Native Kotlin app with WebView examples/android -
iOS Native Swift app examples/ios -

Each example demonstrates:

  • Creating new recovery setups
  • Restoring existing accounts
  • Factor selection and configuration
  • WebView/QR code integration
  • Automatic polling for recovery completion
  • Key display and management

πŸ—οΈ Architecture

The SDK follows a zero-knowledge architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Your App    │────────▢│ Unforgettable│◀────────│ User Device β”‚
β”‚ (SDK)       β”‚         β”‚ App (WebView)β”‚         β”‚ (Camera)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚                        β”‚
      β”‚                        β”‚
      β–Ό                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Unforgettable API (Encrypted Data) β”‚
β”‚  β€’ No private keys stored           β”‚
β”‚  β€’ Only encrypted shards            β”‚
β”‚  β€’ Cannot decrypt without factors   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Key Generation: Client generates ephemeral key pairs
  2. Encryption: Recovery data encrypted client-side
  3. Storage: Only encrypted shards stored on API
  4. Recovery: User provides only factors β†’ decryption happens client-side
  5. Zero-Knowledge: Server never sees private keys or decrypted data

πŸ› οΈ Development

Prerequisites

  • Node.js 18+ and Yarn 4.x
  • Java 17 (for Android development)
  • Xcode 14+ (for iOS development)
  • Gradle 8.1+ (for Android builds)

Setup

  1. Clone the repository:

    git clone https://github.com/rarimo/unforgettable-sdk.git
    cd unforgettable-sdk
  2. Install dependencies:

    yarn install
  3. Build all packages:

    yarn build
  4. Run tests:

    yarn test              # All tests
    yarn test:ts           # TypeScript/JavaScript tests
    yarn test:swift        # iOS Swift tests
    yarn test:kotlin       # Android Kotlin tests

Monorepo Structure

unforgettable-sdk/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/          # TypeScript/JavaScript SDK
β”‚   β”œβ”€β”€ react/         # React components and hooks
β”‚   β”œβ”€β”€ android/       # Android SDK (Kotlin)
β”‚   └── ios/           # iOS SDK (Swift)
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ react/         # React web example
β”‚   β”œβ”€β”€ react-native/  # React Native mobile example
β”‚   β”œβ”€β”€ android/       # Android example app
β”‚   └── ios/           # iOS example app
└── scripts/           # Build and release scripts

Available Scripts

yarn build             # Build all packages
yarn lint              # Lint TypeScript code
yarn test              # Run all tests
yarn publish:stable    # Publish packages to NPM

πŸ”§ Troubleshooting

Android: Java 17 Not Found

If you encounter this error:

Cannot find a Java installation on your machine matching: {languageVersion=17}

Solution (macOS):

# Install Java 17
brew install openjdk@17

# Link it
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

# Verify
/usr/libexec/java_home -V

TypeScript Build Errors

# Clean and rebuild
yarn clean
yarn install
yarn build

iOS CocoaPods Issues

cd packages/ios
rm -rf Pods Podfile.lock
pod install

πŸ“š Documentation


🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style (ESLint for TypeScript, Ktlint for Kotlin, SwiftLint for Swift)
  • Add tests for new features
  • Update documentation
  • Ensure all tests pass (yarn test)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright Β© 2025 Zero Block Global Foundation


πŸ”— Links


πŸ™ Acknowledgments

Built with ❀️ by the Rarimo team and contributors.

Powered by: