Scotland made the brighter start, Jonny Gray rampaging into the Welsh 22, only to be the masters of their own downfall inside the first 15 minutes, two mistakes from scrum-half Ali Price leave them 14-0 down.
First, the No 9 delayed his pass a second too long at the halfway line, allowing opposite number Gareth Davies to intercept and streak away.
Then, when Steff Evans had dropped an offload and a certain try five metres out, Price was adjudged to have fed the ball into the scrum and seconds later, Halfpenny was over in the corner with numbers to spare.
After a manic opening quarter, the game settled into a rhythm but Scotland looked stereotypically naive, turning the ball over on too many occasions and wincing under the pressure at the set piece.
They were at least able to stop the flow of points but that resistance broke immediately after half-time as four penalties in the first 10 minutes of the second half offered Halfpenny ample opportunity to stretch the lead.
The full-back has been repeatedly criticised for his lack of try-scoring, viewed as a defensive pick and one that coach Warren Gatland favours because of his reliability.
But on this occasion he turned poacher, adding a second try just after the hour mark to break his drought in emphatic style, going over from three metres thanks to concerted pressure on the Scottish try-line and more directly fast hands from Evans.
And after Wyn Jones had the fourth cruelly denied by the TMO, crucially asked for a reason to award not deny a try, Evans went from provider to scorer to seal the bonus point with six minutes remaining.
It was no less than Wales deserved, while Scotland have eight days to regroup before return to Murrayfield to face the French. They will take with them little but bruises and mental scars from their afternoon in Cardiff.