Crystals are the only currency in Heroes & Castles 2. They are used for various things, such as upgrading your castle, units and crafting or forging items. Crystals can also be used to respec your character's skill points or to unlock a new hero.

Earning Crystals:

Action Amount of Crystals earned
Completing a wave in the main campaign 3
Finding a treasure chest has a chance of earning Crystals 1 or 2
Conquering or defending a territory 1
Selling any item 1
Replaying a wave in history mode with another hero 1
Some terriories reward you with a Crystal every [x] number of battles Amount of Crystals varies
Completing achievements Amount of Crystals varies

Crystals can also be bought as in-app-purchases (IAPs):

Price (USD) Amount of Crystals
0.99$ 30
1.99$ 75
4.99& 200
9.99$ 500
19.99$ 1200

Purchased Crystals can be restored under Options > Other > Purchases > Restore