We study the optimal design of a central bank digital currency (CBDC) in an environment where agents sort into cash, CBDC and bank deposits according to their preferences over anonymity and security; and where network effects make the convenience of payment instruments dependent on the number of...