Tim Paine has resigned as the captain of the Australian cricket team ahead of the Ashes 2021 contest against England over a scandal in 2017.