[Tutorial] PeerAssets Peer to Peer (p2p) Transactions


In the last tutorial, we covered creation of a deck the issuing of cards with a MULTI type deck. MULTI meant that I would be able to issue as many cards as I wanted at any given time as I needed. However, lets pretend that I didn’t own the deck and that I had received 100 PeerCookies. I am browsing our reddit (https://www.reddit.com/r/peercoin) and see a funny comment by a Peerchemist. Last time, we issued him cards at will, but I no longer have that power, so instead we will be transferring cards. This is of primary importance for person-to-person or p2p transactions. To check your own address, you can use:

pacli address show

My address is: mv1iTX441manxM6ATMAVffMfXzhayB1mGD

Since I don’t hold any PeerCookies in this address, I will issue myself 100. Be patient as it takes this transaction is validated.

Previously, we used “pacli card issue”, but this time we will be using “pacli card transfer” as my address (mv1iTX441manxM6ATMAVffMfXzhayB1mGD) contains 100 cards and I am no longer spawn cards, but rather just sending them back and forth. This is the experience of most people who will be using assets, or even use cryptocurrencies.

Think of it like this: Your mother packs you and your brother each a lunch [deck] for school. In each lunch is a variety of food items [cards] (apples, sandwich, pudding). Since you are not the mother and cannot issue lunches, you must transfer objects with your brother if you want to make an exchange. Previously, we spawned decks like the mother, and transfered cards out, but now we are simulating just being a recipient with no control. In this instance, we will note the “–deckid” in case we have another deck we would want to use, “–reciever” to specify the address we are sending our cards to, “–amount [100]” to signal that we want to send 100 cards. As always “–sign” and “–send” are used to finalize the transaction and broadcast it.

pacli card transfer --deckid 310403a934bacd3fabb2bf4bb83cb0429c7d25907e623815ef494d62fa042a67 --receiver [mstyWZRR9VyYpRRyZ4Fd5Bvcua5mPujj3k] --amount [100] --sign --send

You can see the transaction on the testnet here: https://chainz.cryptoid.info/ppc-test/tx.dws?e130491b10ce0fbc4ce274515b98d5e1c0a38da00e03c7e160d2e87f2c3b63f7.htm

After enough confirmations, the PeerCookies should appear in the address: mstyWZRR9VyYpRRyZ4Fd5Bvcua5mPujj3k. This is the simple way to do peer to peer or p2p transactions using PeerAssets.

If you generated a deck and want to test sending assets, send them my way and drop a comment below for me to look for them :slight_smile:

Testnet Address: mv1iTX441manxM6ATMAVffMfXzhayB1mGD


Who can write a Chinese instruction manual for pacli?


Can’t you translate?


I haven’t finished the test yet, so it’s difficult to translate it accurately.
If I can understand PA well, then I can translate easily.