In European folklore, the blacksmith has sometimes been associated with malevolence (the medieval vision of Hell may draw upon the image the smith at his forge), and several variant tales tell of smiths entering into a pact with the devil to obtain fire and the means of smelting metal. “The Smith and the Devil” is a story is of a smith who makes a pact with a malevolent being—commonly the Devil (in later times), Death or a genie—selling his soul for some power, then tricks the devil out of his prize. In one version, the smith gains the power to weld any materials, then uses this power to stick the devil to an immovable object, allowing the smith to renege on the bargain.
https://www.bbc.com/news/uk-35358487
https://www.revolvy.com/page/The-Smith-and-the-Devil