Since Ethereum is a general-purpose blockchain platform, it can store nullifier set and roots of the incremental note commitment tree. I was wondering if it’s possible to implement the Zcash protocol as a Solidity contract.
Yes, it has been done before. There was a project called Baby ZOE (Zcash on Ethereum)
The topic is discussed with details in another forum, have a look https://blog.ethereum.org/2017/01/19/update-integrating-zcash-ethereum/
I think the BabyZoE project actually implements the zerocoin protocol with the merkle tree storing the set of note commitments. And the note in babyzoe consists of two parts: (r, serial_number).