# Basic blockchain concepts

## What is a mnemonic phrase?

A **mnemonic phrase** is an alternative form of representation for a private key. It was first proposed in the **BIP39 mnemonic phrase scheme**. Its purpose is to allow users to remember complex private key strings. Mnemonic phrases usually consist of 12, 15, 18, or 21 words. These words are selected from a fixed database of 2049 words, and the sequence of the words is also determined using an algorithm.

The mnemonic phrase mechanism has been put in place to make the process of memorizing the private key a little easier, but it is crucial to save the mnemonic phrase at a secure location, since anyone with access to this mnemonic phrase can gain complete control of the wallet and all of its assets.

{% hint style="warning" %}
It is also important to understand that their is only **one chance** to save the mnemonic phrase, i.e, at the time of registration. Please ensure that it is saved in a secured location.
{% endhint %}

## What is keystore?

**Keystore** allows the user to store the private key in an encrypted form. The custom set password in tandem with the `ONT ID` puts in place a safeguard to the encrypted private key and the wallet.

{% hint style="warning" %}
It is extremely important to take note of this password. In case the password is lost, there is **no way for ONTO to retrieve or change it**, and access to the wallet account will be lost completely.
{% endhint %}

## What is a plaintext and WIF private key?

**Plaintext** private key is the randomly generated private key in the form of a string that is corresponds to a particular wallet account. It is used to carry out authentication and the signature process necessary for any transaction.

The **Wallet Import Format (WIF)** private key is a format that is used to represent the private key using `Base58` checksum encoding.

{% hint style="warning" %}
Anybody with access to **WIF** or the private key to an account can assume **full control** of that account and carry out transactions or even change the login password of the said account without knowing the original password.
{% endhint %}

## What does the rollback mechanism refer to?

The rollback mechanism is a safeguard that has been put in place to insure consistency and integrity of the blockchain data. A transaction always depends on a set of conditions such that only in the case that all the conditions are fulfilled does the transaction proceed. In case any one of the conditions fails, the transaction as a whole fails, and thus all the changes that have occurred as a consequence of the said transaction should be **rolled back**, so to speak, to their original state before the transaction was carried out.

The respective functions involved in the transaction return an error or throw exceptions when this occurs, and that is how the rollback is initiated.

With respect to **Ontology**, Compiler v1.0 can use raise `Exception("error msg")`, and compiler v2.0 can use both raise `Exception("error msg")` or `assert(condition)`.

{% hint style="info" %}
It is recommended that developers use **compiler v2.0's** `assert()` method, as it has a special property that ensures no transaction fees are levied if the function returns an error.
{% endhint %}
