Skip to content

Mining in Logarithmic Space - adaptations for variable difficulty and DAG #3

@someone235

Description

@someone235

Mining in Logarithmic Space (MLS) is a work by Kiayias et al. that enables pruning headers by saving a logarithmic amount of super blocks. Super blocks are divided to levels: a level-1 super block is a block with hash < target/2, level-2 super block is a block with hash < target/4, level-3 super block is a block with hash < target/8 and so on.

We propose two changes to MLS:

  1. An adaptation for variable difficulty.
  2. An adaptation for DAGs.

MLS with variable difficulty

The idea is very simple: instead of considering a level μ super block as block with hash < target/2^μ, we define it as hash < max_target/2^μ (max target can be 2256-1, or any other smaller number defined by the protocol). The rest of the protocol will work exactly the same, and the proof size will be log(accumulated_work), instead of log(chain_length) in MLS.

MLS for DAG

Instead of having a chain for each μ, we're maintaining a DAG ↑ μ for each μ. Each block has to point to all level tips in its past.
We'll have some minor changes in the notation proposed in the paper:

  • DAG[i] means the highest block in the GHOST chain of this DAG that has past greater than i
  • DAG[-i] means the highest block in the GHOST chain of this DAG that has future greater than i
  • DAG[i:] means the future of DAG[i]
  • DAG{b:} means the future of block b
  • DAG{:b} means the past of block b

Our Dissolve function will now look like this:

function Dissolve(m, k, DAG)
  DAG* = DAG[:− k]
  D = ∅
  if |DAG*| ≥ 2m then
    l = max{μ : |DAG* ↑ μ | ≥ 2m}
    D[l] = DAG* ↑ l
    for μ = l − 1 down to 0 do
      b = DAG* ↑ μ+1 [−m]
      D[μ] ← DAG* ↑ μ [−2m:] ∪ DAG* ↑ μ {b:}
    end for
  else
    D[0] = DAG*
  end if
  χ = DAG*[−k:]
  return (D, l, χ)
end function

Every other aspect of the protocol will look exactly the same.

Rationale

Our first approach was to run GHOSTDAG for each DAG ↑ μ and to use the GHOSTDAG selected chain as an alternative to the block chain in MLS. This works well on constant hashrate, but it breaks when we apply "MLS with variable difficulty". Because the super block level is defined by log(hash/max_target) and not log(hash/target) the number of super blocks on each level is not regulated by the DAA, so we can't use GHOSTDAG, because it requires the network block rate as an argument.
Instead of that we chose to use the GHOST chain. The GHOST protocol doesn't require the block rate as an argument, and although it doesn't guarantee liveness, it does guarantees that the honest majority respects the given chain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions