Peer-to-peer (P2P) electronic commerce has become increasingly popular over the last few years. This popularity of P2P is due mainly to the many advantages it offers, such as the ease of sharing of computer resources and reducing cost. This paper uses both semi-formal and formal specification methods to model a P2P digital product marketplace. First, models are written in UML, as this is expected to be relatively easy to understand and economic. Then, the models are transformed into a formal notation, object-Z notation. A formally specified and verified model of e-commerce transactions will provide a correct, fail-safe, and robust transaction processing environment for ecommerce. By using both semi-formal and formal methods in the design of the P2P system, we can reason about and create a correct and reliable system quickly and efficiently. application class. Napster attracted 38 million users within one year. P2P e-commerce represents a technological feature in ecommerce rather than an interaction between participants. P2P B2B e-commerce or P2P B2C ecommerce is possible, in which B2B / B2C represents the participants of e-commerce. P2P e-commerce applications are characterized by autonomy of each peer; peers communicate and transact business with unspecified and often un-trusted peers; and the existence of commercial transaction mechanism to facilitate commerce. The following additional features 3 characterize P2P e-commerce applications: distribution, decentralization, self-composing and individualization, and symmetric communication by majority of the peers.Recently, P2P-based publication and subscription systems appeared. The publish -subscribe system is a communication paradigm that supports many-to-many communication in a distributed environment, and it is often implemented on P2P infrastructure that enables information dissemination from publishers to subscribers. Liu, et al. 4 and Wang, et al. 5 discuss subscription mechanisms and the relevant security issues in the model.