It is commonly believed that quantum information is not lost in a black hole. Instead, it is encoded into non-local degrees of freedom in some clever way; like a quantum error-correcting code. In this talk, I will discuss recent attempts to resolve some paradoxes in quantum gravity by using the theory of quantum error-correction. First, I will introduce a simple toy model of the AdS/CFT correspondence based on tensor networks and demonstrate that the correspondence between the AdS gravity and CFT is indeed a realization of quantum codes. I will then show that the butterfly effect in black holes can be interpreted as non-local encoding of quantum information and can be quantitatively measured by out-of-time ordered correlations. Finally, I will discuss how out-of-time ordered correlations, measured outside the black hole horizon, may probe smoothness of the geometry across the horizon.