Recently network analysis has gained more and more attentions in statistics, as well as in computer science, probability, and applied mathematics. Community detection for the stochastic block model (SBM) is probably the most studied topic in network analysis. Many methodologies have been proposed. Some beautiful and significant phase transition results are obtained in various settings. In this paper, we provide a general minimax theory for community detection. It gives minimax rates of the mis-match ratio for a wide rage of settings including homogeneous and inhomogeneous SBMs, dense and sparse networks, finite and growing number of communities. The minimax rates are exponential, different from polynomial rates we often see in statistical literature. An immediate consequence of the result is to establish threshold phenomenon for strong consistency (exact recovery) as well as weak consistency (partial recovery). We obtain the upper bound by a range of penalized likelihood-type approaches. The lower bound is achieved by a novel reduction from a global mis-match ratio to a local clustering problem for one node through an exchangeability property.1. Introduction. Network science [10,23,28,17] has become one of the most active research areas over the past few years. It has applications in many disciplines, for example, physics [24], sociology [29], biology [4], and Internet [2]. Detecting and identifying communities is fundamentally important to understand the underlying structure of the network [12]. Many models and methodologies have been proposed for community detection from different perspectives, including RatioCut[13], Ncut [26], and spectral method [19,25,16] from computer science, Newman-Girvan Modularity [12] from physics, semi-definite programming [7,14] from engineering, and maximum likelihood estimation [3,6] from statistics.Deep theoretical developments have been actively pursued as well. Recently, celebrated works of Mossel et al. [20,21] and Massoulie [18] considered balanced two-community sparse networks, and discovered the threshold phenomenon for both weak and strong consistency of community detection. Fur-