It very possibly is illegal as most countries do not like people modifying their currency. I very cautiously suggest that if you are doing it once for personal use and with a low denomination coin, they will possibly not view it too seriously.
Chat with our AI personalities