When an eggshell is soaked in vinegar, the acetic acid reacts with the calcium carbonate in the shell. Additionally, the acidic environment protonates the proteins in the eggshell, giving them a positive charge that allows them to bind to the acidic dye molecules.