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 … deposits, and can be interest-bearing: a CBDC that closely competes with deposits depresses bank credit and output, while a …