Layer 2 networks process transactions off Ethereum's main chain and post data back to it. Here is how optimistic and zero-knowledge rollups differ.