The article presents the economic model used to quantify credit risks under the Basel II capital accord, which is likely to come into force in 2007, and the mathematical background to this. It employs simplified assumptions to model insolvency courses (the probability of insolvency being proxied by a single common macroeconomic factor) and the size distribution of portfolio receivables (each negligible in size compared with the whole portfolio). Thus the risk contributions by parts of the portfolio (or even a single receivable) can be gauged simply from knowing their risk characteristics. Lending banks have to cover the risk contributions with regulated amounts of capital, which in this model stand for the economic capital requirement of the transactions. The big advantage of the Basel II model, therefore, is that the capital requirement of a specific transaction by a specific debtor rests only on the risk features of the debtor and the transaction. Determining capital requirement does not require detailed knowledge of the transaction's portfolio, and a basically portfolio-oriented economic model can generate general, portfolio-independent rules for capital creation. The paper also considers in what cases rejection of the criterion of infinitely fine granularity causes a significant increase in risk and how a prudent capital requirement can be determined by simple means in such cases. This increase in capital requirement independent of portfolio concentration and relatively easy to calculate is called the granularity adjustment. The adjustment values for homogenous portfolios of insolvency risk of different granularities are also givenin table form.