I recommend the book "Guarding the Prison for a Hundred Years, and the Demon Lord is Exposed" to you. The plot is somewhat similar to what you described. The protagonist Su Bai was locked up in prison. The prison administrator was his enemy and wanted him to be locked up there forever. However, Su Bai had made a Sin-Cleansing Cauldron which could suppress people in prison. Those who were suppressed by the Sin-Cleansing Cauldron could get rewards for cultivation. Later on, the return of the Demon Lord broke Su Bai's peaceful life. Su Bai was reborn and led the demon army to attack Great Xia. His Cauldron of Purification became the key. I hope you like my recommendation. Muah ~