Configuration file structure

Let's start by giving an example of a fairly more advanced config file, demonstrating some/most of the functionalities.
{
    "pools": [
        {
            "url": "stratum-eu1.hashlink.eu:13031",
            "user": "Login.worker",
            "pass": "XYZ",
            "diffMultipliers": {
                "stratum": 1,
                "one": 256,
                "share": 256
            },
            "algo": "fresh",
            "protocol": "stratum",
            "name": "FRESH-hashlink"
        },
        {
            "url": "birdspool.no-ip.org:3333/",
            "user": "omissis",
            "pass": "irrelevant",
            "diffMultipliers": {
                "stratum": 1,
                "one": 1,
                "share": 1
            },
            "algo": "grsmyr",
            "protocol": "stratum",
            "name": "MYR-grsmyr-birdspool"
        },
        {
            "url": "tanukifu.ddns.net:5567",
            "user": "wallet+0.0075",
            "pass": "meh",
            "diffMultipliers": {
                "stratum": 256,
                "one": 256,
                "share": 256
            },
            "algo": "qubit",
            "protocol": "stratum",
            "name": "MYR-qubit-USA_E"
        },
        {
            "url": "stratum.ftc.theblocksfactory.com:3333",
            "user": "login.worker",
            "pass": "password",
            "diffMultipliers": {
                "stratum": 1,
                "one": 65536,
                "share": 65536
            },
            "algo": "neoScrypt",
            "protocol": "stratum",
            "diffMode": "neoScrypt",
            "name": "FTC-TheBlocksFactory"
        }
    ],
    "algo": "qubit",
    "driver": "OCL",
    "implParams": {
        "qubit": [
            {
                "impl": "fiveSteps",
                "linearIntensity": 384
            }
        ],
        "fresh": [
            {
                "impl": "warm",
                "linearIntensity": 256
            }
        ],
        "grsmyr": [
            {
                "impl": "monolithic",
                "linearIntensity": 384
            }
        ],
        "neoScrypt": [
            {
                "impl": "smooth",
                "linearIntensity": 64
            }
        ]
    }
}
Or, a more compact, yet complete form
{
    "pools": [ ... ],
    "algo": "qubit",
    "driver": "OCL",
    "reconnectDelay": 120,
    "implParams": { ... }
}
Differently from legacy miners, settings in M8M are hierarchical in nature. It means that stuff goes inside other stuff rather than having a big blob. Let's took at the simple settings first.

The pools array

Must contain a sequence of objects in the following form:
{
    "url": <string>,
    "user": <string>,
    "pass": <string>,
    "algo": <string>,
    "diffMultipliers": {
        "stratum": <number-greater-than-0>,
        "share": <number-greater-than-0>,
        "one": <number-greater-than-0>,
    },
    // optional below
    "name": <string>,
    "protocol": <string>,
    "merkleMode": <string>,
    "diffMode": <string>,
}
Let's start by considering the must have parameters. Failing to specify one of the above values or specifying it in the wrong format will cause the whole pool setting to be considered invalid.
In contrast, optional parameters have a default value so when they are missing everything will just carry on but if you specify them, they must be in the correct format.

The implParams object

This is a bit more complicated. What it needs to do: after launch, the miner will hash according to a certain algorithm. This object tells the miner the settings to use for each algorithm. So, for each algorithm you want to use (either by config or by --algo) you need to have a corresponding value inside this object. The value corresponding to the algorithm being mined is extracted and it must be an array.
Each element of this array is then a configuration instructing the miner on how to use the devices.
As of 0.1896 beta this is quite stupid and there's no such point in using more than one configuration each algorithm nonetheless the format of each object is the following:
{
    "impl": <string>,
    ...
}

As a start, M8M selects an algorithm implementation according to the value of the impl key. For valid values, refer to source code. The web monitor also enumerates the possible values for each algorithm.

After an algorithm implementation has been selected, it is possible to consume additional configuration parameters. In theory every algorithm implementation is free to define its own parameters; in practice the only parameter available (as of 0.1.896 beta) is linearIntensity which value is an positive not-zero integer. You can find example values for linearIntensity at the releases page. In practice those values will be "big" (128 and up) for mathematically-intensive algorithms and "small" (starting from 16) for "memory hard" algorithms.

So in practice, objects will look like
{
    "impl": <string>,
    "linearIntensity": <integer-greater-than-0>
}
In the future, there will be an additional entry in this object: require. Its goal will be to restrict the configuration to specific sets of devices.