Snark: Mimblewimble Compacting

Bitcoin is categorized as a UTXO based system. UTXO define Unspent Transaction Outputs. An account has Inputs described as;

type Transaction struct {
ID []byte
Vin []TXInput
Vout []TXOutput
}
type TXInput struct {
Txid []byte
Vout int
Signature []byte
PubKey []byte
}
type TXOutput struct {
Value int
PubKeyHash []byte
}

A transaction consists of Inputs (value received by the account), and outputs (values sent from the account).

So if Alice has input 1 BTC from Bob, then Bob has output 1 BTC to Alice. If Alice then wishes to send 0.5 BTC back to Bob, and 0.5 BTC to Charlie, Alice would create a transaction with 1 BTC input from Bob, 0.5 output to Bob, and 0.5 output to Charlie.

The Mimblewimble specification has the concept of UTXO compacting. Called Cut-through, it is explained as follows

Blocks let miners assemble multiple transactions into a single set that’s added to the chain. In the following block representations, containing 3 transactions, we only show inputs and outputs of transactions. Inputs reference outputs they spend. An output included in a previous block is marked with a lower-case x.
I1(x1) --- O1
|- O2

I2(x2) --- O3
I3(O2) -|

I4(O3) --- O4
|- O5
We notice the two following properties:
Within this block, some outputs are directly spent by included inputs (I3 spends O2 and I4 spends O3).
The structure of each transaction does not actually matter. As all transactions individually sum to zero, the sum of all transaction inputs and outputs must be zero.
Similarly to a transaction, all that needs to be checked in a block is that ownership has been proven (which comes from transaction kernels) and that the whole block did not add any money supply (other than what’s allowed by the coinbase). Therefore, matching inputs and outputs can be eliminated, as their contribution to the overall sum cancels out. Which leads to the following, much more compact block:
I1(x1) | O1
I2(x2) | O4
| O5

Through compacting, Mimblewimble can reduce all UTXO to single pairs. Balance outputs. This allows the chain to be drastically compacted.

The same can be achieved with finalized transactions and state ouput.

We redefine a transaction as the sum of its inputs and outputs and derive a current state. We can group all similar transactional outputs into single inputs for state transitions.

If Alice sent Bob 0.5 BTC, and Charlie 0.5 BTC, followed by Bob sending 0.25BTC to Charlie, this can be represented as Alice sends 0.25 BTC to Bob and 0.75 BTC to Charlie. This is the concept behind compacting.

Applied over the entire blockchain, we can considerably reduce the amount of transactions that need to be replayed to arrive at the current state, reducing size and sync speed.