As an expanded explaination of SectionChain based on Adam's writeup at [Section chain and proof chain](https://hackmd.io/ERglUv22SrW_c2EjuGz-Cg?both=#1-Section-chain-and-proof-chain).
```rust
pub struct SectionChain {
root: bls::PublicKey,
tree: Vec<Block>,
}
struct Block {
key: bls::PublicKey,
signature: bls::Signature,
parent_index: usize,
}
```
Only the root key (the genesis key) is not signed. All other keys are signed by its parent.
It’s possible the chain contains two or more keys that are all signed with the same parent key, but the chain still presents the keys in a single linear sequence to the outside (thus the “chain” in the name).
i.e. forks (conflicts) are not prevented but are immediately resolved.
The fork resolution is completely local (doesn’t require any coordination with the other nodes). The order is established using this algorithm:
1. Arrange the keys in a tree where a key that signs some other key is its parent.
2. Sort the keys having the same parent numerically (using the Ord relation of the PublicKey type)
3. Walk the resulting tree in a breadth-first fashion
Example (assuming the lexicographical order corresponds to the numerical order here):
```
A->B->C->D
|
+->E->F->G
|
+->H
```
Would be sorted as:
```
A->B->C->E->D->F->H->G
```
Branch: Iterator over the blocks along chain in reverse order.
Main branch: the branch of blocks that is reachable from the last block.
The main_branch of the above example will be:
```
A-> B-> E-> F-> G
```
A chain is considered as trusted only if at least one of the `trusted_keys` is on its main branch.