In recent years, the booming growth of the cryptocurrency market has garnered significant attention from a diverse range of investors with the overall market capitalization experiencing continuous expansion. This surge in popularity, however, is accompanied by challenges arising from the market's inherent high volatility and complexity. The increasing diversity of available assets presents investors with a complex landscape to navigate. The quest to build an optimal investment portfolio has become a focal point, particularly as market participants seek strategies that not only capitalize on the market's potential for substantial returns but also effectively manage the inherent risks. In this paper, nine cryptocurrencies have been chosen to construct the portfolios, which include BTC, Ether, Tether, Binance, ripple, USDC, ADA, DOGE and TRX. The data selected comprises the daily price of the above assets from November 1, 2020, to October 9, 2023. This paper presents a comprehensive framework for constructing and optimizing cryptocurrency investment portfolios, by employing the Markowitz model and Sharpe ratio analysis. We examined these nine selected digital currencies to determine the optimal investment allocation. Our findings suggest that the highest sharpe ratio is achieved when each investment cryptocurrencies (according to the order above) allocates 0, 0.003, 0.762, 0.038, 0.005, 0.172, 0, 0.014 and 0.007, respectively, to each cryptocurrency. And the lower risk portfolio is obtained when each cryptocurrencies accounted for 2.740e-20, 6.315e-20, 0.5, 0, 0.001, 0.499, 0, 1.419e-04 and 4.210e-20, respectively. This study contributes to the sustainable development of the cryptocurrency market by providing valuable insights for financial institutions, policymakers, and other stakeholders. However, limitations of this research come from the small number of selected digital currencies and the exclusion of risk-free assets such as government bonds. Future research should consider expanding the sample size and incorporating risk-free rates to enhance the applicability and reliability of investment strategies. In conclusion, this research offers investors a practical framework to navigate the complexities of the cryptocurrency market and optimize their investment decisions for long-term value appreciation.