According to Wikipedia:
Pygg is an orange colored clay commonly used during the Middle Ages as a cheap material for pots to store money, called pygg pots or pygg jars. There is dispute as to whether "pygg" was simply a dialectal variant of "pig." By the 18th century, the term "pig jar" had evolved to "pig bank"
However, several boar-shaped piggy banks originating from the 15th century have been discovered in East Java.
Is there any relationship between the early use of piggy banks in the West and Middle East, and the early use of piggy banks in Java? Did one region influence the other?
Or perhaps they had a common origin? There's [speculation] (https://www.scienceabc.com/eyeopeners/why-are-so-many-personal-coin-banks-shaped-like-pigs.html) online that the first piggy banks were made in China, with pigs being a traditional symbol of prosperity.
The origins of piggy banks have been asked before on Askhistorians, but without any answers. Hoping that someone can shed some light on this subject.
Followup question:
In Javanese mythology there's a creature/black magic called babi ngepet, where it's used to steal someone's wealth. Is there any relation between piggy bank and babi ngepet? I assume both are connected through the association of pig = wealth.