Nimiq Identicons

Visual address verification using Nimiq Identicons

Why Nimiq Identicons?

Protection Against Clipboard Hijacking

In 2019, researchers discovered the first clipper malware on Google Play Store targeting cryptocurrency users. Nimiq Identicons were designed specifically to combat this threat.

The Problem with Crypto Addresses

Traditional cryptocurrency addresses pose two major challenges:

  1. They are long, complex strings that are difficult to verify
  2. They are vulnerable to clipboard hijacking attacks
Clipboard hijacking threat
Traditional vs Nimiq IdenticonsNimiq Identicon examples

The Solution

"IMHO, too much of the web what we read are textual or numeric information which are not easy to distinguish at a glance when they are jumbled up together. So I think adding visual identifiers will make the user experience much more enjoyable."

— Don Park, creator of the identicon concept

Nimiq Identicons solve these problems by:

  • Providing instant visual verification
  • Being highly memorable and describable
  • Making address tampering immediately obvious
  • Supporting natural human pattern recognition

How to Use

Installation

npm install identicons-esm

Basic Usage

Create a simple identicon:

import { createIdenticon } from 'identicons-esm'
 
const input = 'Your input here'
const svg = await createIdenticon(input)

Implementation Examples

import { createIdenticon } from 'identicons-esm';
 
const input = 'NQ05 U1RF QJNH JCS1 RDQX 4M3Y 60KR K6CN 5LKC';
const svg = createIdenticon(input);
 
// Insert the SVG into your HTML
document.getElementById('identicon').innerHTML = svg;

Advanced Customization

Customize colors and sections:

import { ensambleSvg, formatIdenticon, getIdenticonsParams } from 'identicons-esm'
 
const input = 'Your input here'
const { colors, sections } = await getIdenticonsParams(input)
 
// Customize parameters
// colors: { background, main, accent }
// sections: { top, bottom, sides, face }
 
// Generate custom SVG
const customSvg = ensambleSvg({ 
  colors, 
  sections,
  // Optional: backgroundShape, innerShadow, circleShape
})
 
// Change format
const formatted = formatIdenticon(customSvg, { 
  format: 'image/svg+xml' 
})

How It Works

Technical Details

Each Identicon is composed of five distinct elements:

  • Bottom shape
  • Face features
  • Side elements
  • Top design
  • Color combinations

Components

  • 21 different bottoms
  • 21 unique faces
  • 21 side variations
  • 21 top designs
  • 8 part colors
  • 9 body colors
  • 10 background colors

Total Combinations

Over 140 million unique combinations:

10 * 9 * 8 * 21⁴ = 140,026,320

Security Benefits

  1. Instant Detection: If a clipboard hijacker replaces an address, the Identicon will immediately look different
  2. Natural Verification: Instead of comparing long strings, users can say "It's the orange unicorn with green eyes"
  3. Visual Memory: Humans are better at remembering and recognizing visual patterns than text
  4. Simple Communication: Easily verify addresses over any communication channel
  5. User-Friendly Security: Protection without complex technical requirements

Real-World Impact

When MetaMask was impersonated on the Google Play Store, the malware could replace crypto addresses in clipboards, affecting millions of users. Nimiq's visual verification system makes such attacks immediately obvious to users.

Migration Guide

SVG Generation

import { createIdenticon } from 'identicons-esm'
 
const input = 'Your input here'
const svg = createIdenticon(input)

Data URI Generation

import { createIdenticon } from 'identicons-esm'
 
const input = 'Your input here'
const dataUri = createIdenticon(input, { 
  format: 'image/svg+xml' 
})

Discontinued Features

The following legacy functions are not available in the new implementation:

  • makeLetterHash
  • wordsByEntropy
  • Identicons.render
  • Identicons.image
  • Identicons.placeholder

On this page