Context. The paper is concerned with heating of the solar corona by nanoflares: a superposition of small transient events in which stored magnetic energy is dissipated by magnetic reconnection. It is proposed that heating occurs in the nonlinear phase of an ideal kink instability, where magnetic reconnection leads to relaxation to a state of minimum magnetic energy. Aims. The aim is to investigate the nonlinear aspects of magnetic relaxation on a current loop with zero net axial current. The dynamical processes leading to the establishment of a relaxed state are explored. The efficiency of loop heating is investigated. Methods. A 3D magnetohydrodynamic numerical code is used to simulate the evolution of coronal loops which are initially in ideally unstable equilibrium. The initial states have zero net current. The results are interpreted by comparison both with linear stability analysis and with helicity-conserving relaxation theory. Results. The disturbance due to the unstable mode is strongly radially confined when the loop carries zero net current. Strong current sheets are still formed in the nonlinear phase with dissipation of magnetic energy by fast reconnection. The nonlinear development consists first of reconnection in a large scale current sheet, which forms near the quasi-resonant surface of the equilibrium field. Subsequently, the current sheet extends and then fragments, leading to multiple reconnections and effective relaxation to a constant α field. Conclusions. Magnetic reconnection is triggered in the nonlinear phase of kink instability in loops with zero net current. Initially, reconnection occurs in a single current sheet, which then fragments into multiple reconnection sites, allowing almost full relaxation to the minimum energy state. The loop is heated to high temperatures throughout its volume.