Skip to content
Last updated

Blockchain basics for developers

Learn how addresses, public keys, amounts and confirmations appear in Vilna’s API. No blockchain experience is required. Already familiar with these concepts? Start with Core concepts.

Non-custodial - Vilna never holds funds Read-only - public keys only One shape across every chain Built on open standards

What a blockchain is

Forget the hype for a moment. For an integration, a blockchain is just a shared record book that everyone can read and no one can secretly edit. New transactions extend that record; reorganizations can replace recent blocks.

Three properties are all you need to hold in your head:

Public

Every transaction and balance is visible to anyone. There are no private queries to run; you just read the chain.

Append-only

Blocks normally extend the chain, but a reorganization can replace recent blocks and change which transactions are included. Reconcile current state before relying on a receipt.

Grouped into blocks

New records are bundled into blocks added one after another. A block's position is its place in time.

A public ledger can be monitored using an address, without the wallet owner's permission. Platform monitoring reads that public data.

Where Platform monitoring sits

Reading a chain yourself means running nodes, indexing blocks, handling reorgs and decoding every transaction format, all of it per chain. Platform does that for supported networks and returns normalized data. Platform monitoring observes the chain:

What Platform monitoring needs

An address or a public key. That is enough to watch balances, detect incoming funds and notify you.

What Platform monitoring does not need

Your private key or seed phrase. Platform monitoring does not sign transactions, broadcast them or move funds.

Non-custodial means non-custodial

Platform monitoring reads public chain data and reports what happened. VKS is a separate workflow for signer approvals, signing and optional transaction submission; see the VKS guide.

Keys and addresses

For an address controlled by one private key, the relationship between the key and address looks like this:

Private key - the secret used to sign transactions for the corresponding blockchain account. Whoever holds it can spend the funds, so it must never leave your control.

Public key - derived from the private key with one-way math. Safe to share. You can go from private to public, but never back.

Address - a short, shareable identifier derived from the public key. This is the "account number" people send funds to.

The takeaway for integration: the address and public key are safe to share; the private key is not. Platform monitoring uses the public side: provide a public key or address to watch it. It does not need the private key.

Guard the private key

Anyone with the private key (or the seed phrase it comes from) controls the funds. Never put it in code, logs, screenshots, or a request to any API, including Vilna. Platform monitoring does not need it.

Reading an address

Address formats can suggest a chain family, but the address alone does not identify the network. Check the chain identifier as well as the address before sending:

Chain familyLooks likeExample
EVM (Ethereum, Polygon, BSC, Arbitrum, Base…)0x + 40 hex chars0x742d…7B123
Bitcoin - Legacystarts with 11A1zP1…DivfNa
Bitcoin - SegWit-compatiblestarts with 33J98t1…hWNLy
Bitcoin - Native SegWitstarts with bc1qbc1qar0…f5mdq
Bitcoin - Taprootstarts with bc1pbc1p5d7…g3s7p
TRONstarts with T, 34 charsTXk7…m4Qa
Solanabase58, ~44 chars5eykt4…KvdpZ

One convenient detail of EVM chains: a single 0x… address works on every EVM network. The same Ethereum address can receive funds on Polygon, Arbitrum or Base without any change.

When you register an address with Vilna you pass input.chain_family (evm, bitcoin or tron; solana registers the address and resolves its tokens, without balances or transactions) and the exact format is auto-detected from the value; see the Platform API for the endpoints.

One wallet, many addresses

Real products need a fresh address per customer, sometimes thousands of them. Generating and backing up thousands of independent secrets is unmanageable. HD wallets (Hierarchical Deterministic) solve this with a single starting secret.

You begin with one seed phrase, typically 12 or 24 words. From that seed, the wallet can generate an unlimited tree of key pairs. Deterministic means the same seed always produces the same keys, in the same order, forever. A derivation path is the route down that tree to one specific key: pick a branch at each level and you arrive at a single address:

One derivation pathm / 44' / 60' / 0' / 0 / 2
MASTERPURPOSECOINACCOUNTCHANGEINDEXmmaster49'nested44'BIP-4484'native0'BTC60'ETH195'TRON0'account 01'account 10receive1change0address1address2address
Each row is one level of the path. At every level you pick one branch; the lit route runs down to a single address. A ' marks a hardened level (explained below).

One seed backup covers the derived addresses; a fresh address per customer is the exchange monitoring pattern.

Extended public keys and derivation paths

To let Vilna generate and watch that tree of addresses without ever touching the secret, you share an extended public key: a special public key that can produce child addresses (and only addresses, never signatures). Bitcoin has three flavours, one per address style:

Key prefixStandardGenerates
xPubBIP-44Legacy addresses (start with 1)
yPubBIP-49SegWit-compatible addresses (start with 3)
zPubBIP-84Native SegWit addresses (start with bc1q)

For EVM chains you use an xPub (BIP-44). For Bitcoin Taproot there is no single-letter prefix; use an xPub with the Taproot path below.

How a derivation path works

A derivation path is the "address inside the tree", like a folder path that points at one exact key. It reads left to right, narrowing from the master key down to a single address:

m

The root of the tree - your wallet's master key. Everything descends from here.

e.g. master key
44'

Purpose - which standard the path follows: 44, 49, 84 or 86.

e.g. BIP-44
60'

Coin type - which blockchain, from the SLIP-44 registry: 60 = ETH, 0 = BTC, 195 = TRON, 501 = Solana.

e.g. Ethereum
0'

Account - lets one wallet hold separate sub-wallets. Almost always 0.

e.g. account #0
0

Change - 0 for addresses that receive funds, 1 for internal change addresses.

e.g. receiving
0

Index - the address number. Bump it for each new address: 0, 1, 2, 3…

e.g. first address

The apostrophe (') after a number means hardened: a safety feature that stops a child key from being used to work backward to its parent. You will mostly copy known-good paths rather than hand-build them:

PathUse it forStandard
m/44'/60'/0'Ethereum and all EVM chainsBIP-44
m/84'/0'/0'Bitcoin - Native SegWitBIP-84
m/86'/0'/0'Bitcoin - TaprootBIP-86
m/44'/0'/0'Bitcoin - LegacyBIP-44
m/44'/195'/0'TRONBIP-44
m/44'/501'/0'SolanaBIP-44
Match your wallet

Export the extended public key for the account and address format you plan to monitor. Keep the wallet's derivation path with it; the table lists common account-level paths.

Import the extended public key with POST/public-keys, then call POST/public-keys/{public_key_id}/addresses with "chain_family": "evm", "selection": {"kind": "next"} in the body to mint the next address in the sequence. Each one is registered for monitoring automatically.

Getting your xPub

Most wallets can export an extended public key. The three most common sources:

Ledger Live

Open an account, go to Advanced settings, and copy the Extended Public Key.

Trezor Suite

Open an account and choose Show xPub.

MetaMask

Account-based, so it can't export an xPub. Import individual addresses into Vilna instead.

Export the public key using your wallet. Never send a seed phrase or private key to Vilna. Then register the extended public key and derive addresses; the operation pages contain parameters and request examples.

The seed is the keys

The mnemonic (seed phrase) can regenerate every private key in the wallet. Never expose it in code, logs or version control. For HD address derivation, Platform monitoring needs the xPub, not the mnemonic.

Naming chains and assets

With dozens of chains and thousands of tokens, a phrase like "USDT on BSC" isn't precise enough for code to act on: there are test networks, bridged copies and look-alike contracts. So Vilna leans on two open standards that turn any chain or asset into one exact, unambiguous string you and the API both agree on: CAIP-2 names a chain, and CAIP-19 names an asset on that chain.

You rarely type these by hand; Vilna returns them ready-made in every response. The goal here is just to recognize one when you see it. Read it left to right: a chain, optionally followed by the asset living on it.

What you meanThe ID Vilna uses
Ethereum, the networkeip155:1
BNB Smart Chaineip155:56
BTC, the native coinbip122:…/slip44:0
USDT on Ethereumeip155:1/erc20:0xdAC17…831ec7
Don't memorize the structure

You don't need to learn how these IDs are built to use the API. When you do need the segment-by-segment anatomy of CAIP-2 (chains), CAIP-10 (accounts) and CAIP-19 (assets), it's all in one place: Standards.

Native coins vs tokens

One distinction worth holding onto, because it shapes how balances and fees work. Every chain has one built-in currency, plus any number of tokens layered on top:

Native coin

The chain's own currency, used to pay transaction fees: ETH on Ethereum, BTC on Bitcoin, SOL on Solana, TRX on TRON. There is exactly one per chain.

Token

A currency built on top of a chain via a smart contract: USDT, USDC, DAI and thousands more. On EVM these follow the ERC-20 standard (fungible) or ERC-721 (NFTs); TRON calls its equivalent TRC-20. A chain can carry unlimited tokens.

The supported chain list is available from the Platform API.

Reading amounts

Blockchains store amounts as whole numbers in a coin's smallest unit (think cents, not dollars, but often with 18 decimal places). Many transaction and balance amounts have two fields:

{
  "base": "1500000000000000000",
  "formatted": "1.5"
}
  • base - the raw integer in the smallest unit (wei for ETH, satoshi for BTC). Exact, never rounded.
  • formatted - the human-readable decimal, ready to print in a UI.
Always do math on base

Use base for every calculation, comparison and stored balance; it can't lose precision. Treat formatted as display-only; it may round very large or very small values.

Invoice amount fields differ; see Core concepts.

From pending to final

A transaction isn't trustworthy the instant it's sent. It earns certainty as the chain grows on top of it. Understanding these stages is what stops you from crediting money that later disappears:

Broadcast. The transaction is sent to the network and waits in a holding area called the mempool. At this point it is pending: visible, but not yet part of the chain.

First confirmation. A miner or validator packs it into a block. It is now on-chain: that is 1 confirmation.

More confirmations. Every new block stacked on top adds another confirmation. The more confirmations, the smaller the chance the transaction is ever reversed.

Confirmation and finality rules differ by network. Choose a confirmation policy for your application rather than treating a fixed block count as a universal guarantee.

Vilna tracks this for you

You don't count confirmations yourself: Vilna notifies once per subscription. A subscription's trigger decides the moment: block waits a fixed number of blocks after inclusion (after_blocks: 0 reports the transaction as seen, not final), network waits for the chain's own confirmation policy, mempool (Bitcoin) fires before inclusion. Want both an early and a later confirmation signal? Create two subscriptions with different triggers. A reported transaction can still drop out in a reorganization; there is no follow-up notice, check the API if you need certainty. See Events & monitoring for the full trigger model.