The digital era is an era everyone has used technology and they are connected to each other very easily. The Smart Payment application is one of the applications that is developing in the digital era. This application is not equipped with security, so there is a concern that hackers will try to change user or even change user data. One of the possible attacks on this application is a cross-site attack (XSS). It is a code injection attack on the user side. Security in the Smart Payment application needs to be improved so that data integrity is maintained. In this research, security optimization is carried out by implementing blockchain. Blockchain has the advantage in terms of security with the concept of decentralization by utilizing a consensus algorithm that can eliminate and make improvements to data changes made by hackers. The result obtained from this study is the implementation of blockchain to maintain the security of payment transaction data on the Smart Payment application from XSS attacks. It is proven by the results of the vulnerability before and after blockchain implementation. Before the implementation of the vulnerability is found, 1 XSS vulnerability had a high level of overall risk. Meanwhile, the result of the vulnerability after blockchain implementation was not found from XSS attacks (the XSS vulnerability was 0 or not found).