System Identity Implementation
------------------------------

Every CIYAM node requires its own "identity" in order to differentiate it from all other nodes and which also
will allow its backup data to be restored (assuming that at least one "backup peer" exists). When it is first
started a list of twelve randomly chosen words (from a small dictionary of 2048 words) appears in the browser
interface (along with fields for a master password that is used to unlock the system when it is restarted).

Keeping Your Identity Secure
----------------------------

In order to be able to later restore backup data the twelve words (also known as "mnemonics") need to kept in
a manner that is secure from theft (including being secure from hacking) and accidental loss. When starting a
node for the first time it would be recommended that no internet connection be provided until after you first
have made a copy of the twelve words (using an analog method such as pen and paper) and have also entered the
master password (which should be typed in twice manually to confirm that it is correct).

The master password is hardened (with over 1.1M hash operations) in order to ensure that any attempt to crack
it by brute force would take a very long time, however, it would still be recommended to use a password which
includes special characters, digits and both lower and upper case letters and which is at least 10 characters
in length.

Calculating Password Strength
-----------------------------

A typical high-end Bitcoin mining device can perform 100 TH/s and although the way that CIYAM hash operations
are performed is not the same (meaning a specific ASIC device would need to be manufactured for this purpose)
this can be a useful way to perform some "back of the envelope" calculations to measure just how much a brute
force attack on a password would cost in terms of hashing time. In order to make the calulations a bit easier
the relevant numbers will be rounded. Although over 1.1M hashes are performed per password attempt the number
will be rounded down to 1M and although there are 95 different characters that could be typed with a standard
keyboard this will be rounded up to 100.

100,000,000,000,000 (100 TH/s - Bitcoin hashing device)
1,000,000 (number of hashes required for a password)
100 (number of possible character values)
10 (recommended minimum password characters)

If a single character password can have 100 possible values then a brute force attack would try each possible
value until the correct password is found (which on average would take 50% of all the possible combinations).
So a password of 2 characters would require on average (100x100)/2 attempts and likewise a password of length
3 would require on average (100x100x100)/2. So with every increase in length the total number of combinations
is multiplied by the number of possible characters. So a password with 10 characters would 100x100x100...x100
or a 1 followed by 20 zeroes (100,000,000,000,000,000,000). Next it needs to be taken into account the number
of hashes per password attempt (1,000,000) so we add another 6 zeros (now 26 zeroes). With the latest hashing
devices able to perform 100 TH/s we would subtract 14 zeroes leaving a 1 followed by 12 zeroes divided by two
(on average) seconds in order to brute force the 10 character password (500,000,000,000 seconds). Again to be
simple assume 600 billion which would require 10 billion minutes or nearly 20,000 years! Even using a pool of
10,000 such devices would take around 2 years in order to complete this brute force attack therefore provided
the password is not a pattern (i.e. it is purely random) then it should never likely be discovered using this
approach.

If the password is not strong then of course it could be brute forced in a small fraction of this time so the
use of a strong password is highly recommended (and should be considered essential if other people could have
physical access to the device).

Restoring an Existing Identity
------------------------------

If wishing to restore an already existing CIYAM system using a new node then the twelve words which initially
appear should be replaced with those that had been written down previously (the master password that had been
used before is not relevant when restoring so a new one can be provided meaning that this is also how one can
restore a system if the master password has been forgotten).

Enhancing Your Identity Security
--------------------------------

It should be noted that the dictionary being used is that defined by BIP39 (being the standard used in crypto
wallets). Although it might be a convenience to use the same words for both your crypto wallet and CIYAM node
THIS SHOULD NEVER BE DONE as it might lead to the loss of all your crypto assets.

As the dictionary is 2048 words each single word is 11 bits (1024 being 10 bits so 2048 being one extra bit).
This means that twelve words is 132 bits, however, to minimise human error the last 4 bits are being used for
a "checksum" (to detect input mistakes) so there are only 128 bits of "entropy" (or randomness) present.

This is a lot of entropy but if wanting to be "future proof" one might want to extend this even further. This
is why some crypto wallets have 18 or 24 words as an option (rather than just 12). The CIYAM node permits you
to add extra characters after the twelve words (with a space separating the last of the twelve words from the
first of the extra characters) which are used to "harden" the 128 bits of entropy (with over one million hash
operations being performed after combining the extra characters with the seed value of the twelve mnemonics).

It should be noted that any extra characters provided are *not* BIP39 mnemonics and so if entered incorrectly
will simply result in the wrong identity (with no error being issued) so be very careful when recording these
along with the other twelve words for safe keeping.

Identity and Mnemonic Passphrase Examples
-----------------------------------------

These are both sample blockchains that have been created purely for testing purposes:

Identity: 6f2680b40
Mnemonics: detect jazz kick ghost novel rifle scout mirror stairs craft outdoor crisp

Identity: 6b24210e8
Mnemonics: taxi act describe attitude focus ugly govern outer note isolate endless act

It should be noted that an identity will always be exactly 9 characters in length and because every character
has one of sixteen possible values this length is enough to provide tens of billions of different identities.

Using additonal characters in order to create a more "future proof" identity:

Identity: 59a23c2bb
Mnemonics: detect jazz kick ghost novel rifle scout mirror stairs craft outdoor crisp #!@A11E4sy