Sandra Weir attacked 82-year-old Mary Logie at the pensioner's home in Fife last January.
The grandmother suffered 31 injuries to her head and neck and sustained defensive wounds as she tried to fight off the attacker.
The attacker then left her victim lying on the ground and returned later to deliver the final blows, prosecutors believe.
Weir, 41, had become friends with Logie in the months leading up to her murder and used the relationship as a way to siphon cash to fund her drug habit.
A jury at the High Court in Edinburgh last month found Weir guilty of the murder.
Judge Michael O'Grady QC, who previously described the manner of Mrs Logie's death as "breathtakingly wicked", handed the killer an automatic life term when she returned to the court for sentencing on Thursday.
He ordered her to spend a minimum of 21 years behind bars before she can even be considered for release.
Logie was a member of Leven Parish Church in Fife and attended regularly.