Cryptocurrencies are crucial in modern commerce and finance, whether at the national, corporate, or individual level. They serve as fundamental currencies for buying and selling, enabling various business transactions. However, the rise of cybercrime has brought about concerns regarding their operations, potential breaches in encrypted currencies, and the security systems managing them. The frequency of attack tactics and the motivation of attackers seeking financial gain are well-known. Many cryptocurrencies lack the necessary algorithms, techniques, and knowledge to effectively detect and mitigate malware, making them vulnerable targets for hackers. In this study, machine learning techniques are employed to detect malicious code in digital currencies. Additionally, a comparison of these techniques is conducted to determine the most suitable algorithm and technology, Furthermore, this study highlights the importance of effective malware detection in securing cryptocurrencies. Three datasets of different sizes were used, each yielding distinct results based on dataset size. The AdaBoost model demonstrated superior performance when applied to the short dataset, while the decision tree model performed best with the medium-sized dataset. Conversely, the Naive Bayes model consistently produced the worst results, while the large-size KNN model achieved the highest performance.