Optimistic rollups assume transactions are valid and offer a challenge period, while zero-knowledge solutions use cryptographic proofs to verify transactions instantly, both improving Ethereum layer 2 scalability within the blockchain ecosystem.