Welcome to Nimiq Web Tutorial!
Nimiq is a browser-native blockchain that lets you build decentralized applications without complex setup. No downloads, no installations - just JavaScript that connects directly to the blockchain!
What Makes Nimiq Special?
Most blockchains require you to either:
- Download 100+ GB of data, or
- Trust a third-party service to access the network
Nimiq is different! You can connect directly to the blockchain with just a few lines of JavaScript:
- Browser-Native: Works directly in web browsers
- No Trust Required: Connect directly, no intermediaries
- Zero Knowledge Proofs: Verify everything without downloading everything
- Lightweight: Only downloads what you need
What Makes This Tutorial Special?
- Zero setup required - Everything runs in your browser
- Beginner-friendly - No prior blockchain experience needed
- Hands-on learning - Try code examples immediately
- Real blockchain interaction - Connect to the actual Nimiq network
What You’ll Build
By the end of this tutorial, you’ll know how to:
- ✅ Connect to the Nimiq network and read blockchain data
- ✅ Create wallets and send transactions
- ✅ Work with staking to earn rewards
- ✅ Create cashlinks for shareable payments
- ✅ Build decentralized applications that users can interact with
What You Need to Know
Good news: You DON’T need to understand:
- Complex cryptography (Nimiq handles this)
- Network protocols (handled automatically)
- Consensus algorithms (built-in)
You DO need to understand:
- Async/await patterns (lots of network calls)
- Event-driven programming (blockchain events)
- Error handling (network can be unreliable)
New to Blockchain? No problem! We’ll explain everything as we go.
Why Should I Care About Blockchain?
As a developer, you’re already familiar with:
- APIs → Blockchain is like a decentralized API
- Databases → Blockchain is an immutable database
- Authentication → Blockchain provides cryptographic identity
- State management → Blockchain manages global state
Blockchain adds trust and ownership to these concepts. Instead of trusting a company’s server, you trust math and cryptography.
Real-World Comparison
| Web Development | Blockchain Development |
|---|---|
| REST API calls | Blockchain queries |
| Database transactions | Blockchain transactions |
| User authentication | Wallet signatures |
| Server state | Network consensus |
| API rate limits | No fees on Nimiq! |
Common Developer Misconceptions
- “I need to understand Bitcoin first” → Nimiq is different, start here!
- “Blockchain is too slow for real apps” → Wrong! Only 1 second transaction
- “I need to be a cryptography expert” → The Web Client handles the hard parts
- “It’s just for financial apps” → It can be for decentralized logins, on-chain data, and automated systems. Think outside the box!
Tutorial Overview
- Connecting to the Network: Learn how to connect to Nimiq and explore the blockchain
- Working with Transactions: Create wallets, request test funds, and send your first transaction
- Staking and Validators: Understand Proof-of-Stake and earn rewards by delegating
- HTLC and Cashlinks: Create shareable payment links using Hash Time Locked Contracts
Let’s Get Started!
First, let’s install the tutorial dependencies:
npm installThen try your first example:
npm run basicsDon’t worry if you see errors in the console. They are completely fine.
This will connect you to the Nimiq network and show you live blockchain data. Don’t worry if you don’t understand the code yet! We will talk you through it step by step.
From now on, these commands will be run for you automatically. Simply change the code and the script will restart from the beginning, allowing you to focus on the tutorial.
Other Examples You Can Try
Once you’re comfortable, explore these other examples:
npm run transactions- Send payments and manage walletsnpm run staking- Delegate tokens and earn rewardsnpm run htlc- Create shareable payment links (cashlinks)
About This Environment
This tutorial runs in your browser using WebContainer — a genuine Node.js environment that requires no setup. You get:
- an optimised experience for desktop
- a working terminal (try it below!)
- A complete file system
- All the tools you need to build with Nimiq.
The code you write here will work with any JavaScript environment, including Node.js and modern runtimes such as Deno and Bun. However, you will need to update the code for it to work in a browser. You can learn more about adapting the code for browsers here.
Need Help?
Bugs, Feedback and Ideas
If you find something not working or any kind of feedback, please click Feedback & Bugs and let us know how we can improve this Tutorial.
Ready to build your first blockchain app?