# Handling counterparty assets in my webserver

**URL:** https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238
**Category:** Counterparty
**Created:** [April 16, 2014, 6:48pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238 "2014-04-16T18:48:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![reader31](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@reader31](https://forums.counterparty.io/u/reader31)
#### Post date: [April 16, 2014, 6:48pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/1 "2014-04-16T18:48:40Z")

</div>

[font=verdana][size=13px]I just got some time to play around with counterparty. Was looking to integrate it with a project I’m working on.[/size][/font][font=verdana][/size][size=13px]I need a few high level clarifications regarding this,I want to be able create and move a bunch of counterparty assets amongst bitcoin addresses on my server. So far I have used the BitcoinSCI library to create the bitcoin addresses on my server(using php framework). Now I need figure out the best way to create and distribute counterparty assets between these addresses. Here are two specific questions,1) I want to create one main asset and a bunch of subassets under that. Does counterparty support subassets yet?2) I want to be able to move an asset from an issuer address(Address A) to another address(Address B) without Address B needing to make any payment. Think of it as a free asset or “token” that I would like to award to Address B. Is this possible?I would love to get clarification from the devs or other more knowledgble folks. Thx.[/size][/font]

---

<div class="post-metadata">

### Author: ![Global\_trade\_repo](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Global\_trade\_repo](https://forums.counterparty.io/u/Global_trade_repo)
#### Post date: [April 16, 2014, 11:27pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/2 "2014-04-16T23:27:21Z")

</div>

Counterparty does not have a concept of sub assets. All assets are top level.   
  
In your scenario address B does not need to pay anything if you wish to send assets to B. However, address A would need to pay to broadcast the Counterparty transaction.   
  
If the transactions are all within your web site,&nbsp; you could just move asset between address A and B internally within your database. When the person owning address B wants to ‘cash out’&nbsp; the tokens,&nbsp; they can make a withdrawal request. At that point you would make the transfer. This is similar to how exchanges operate and it would save you the fees that may accumulate over a large number of internal transfers.

---

<div class="post-metadata">

### Author: ![robby\_dermody](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/robby_dermody/32/226_2.png) [@robby\_dermody](https://forums.counterparty.io/u/robby_dermody)
#### Post date: [April 17, 2014, 12:45am UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/3 "2014-04-17T00:45:48Z")

</div>

You should hook into the API for counterpartyd and optionally counterwalletd. Creating your own counterparty transactions manually is not recommended.  
  
  
API docs: [http://counterpartyd.readthedocs.org/en/develop/API.html](http://counterpartyd.readthedocs.org/en/develop/API.html)

---

<div class="post-metadata">

### Author: ![reader31](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@reader31](https://forums.counterparty.io/u/reader31)
#### Post date: [April 18, 2014, 7:49pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/4 "2014-04-18T19:49:37Z")

</div>

[quote author=Global\_trade\_repo link=topic=265.msg1967#msg1967 date=1397705241]  
Counterparty does not have a concept of sub assets. All assets are top level.   
  
In your scenario address B does not need to pay anything if you wish to send assets to B. However, address A would need to pay to broadcast the Counterparty transaction.   
  
If the transactions are all within your web site,&nbsp; you could just move asset between address A and B internally within your database. When the person owning address B wants to ‘cash out’&nbsp; the tokens,&nbsp; they can make a withdrawal request. At that point you would make the transfer. This is similar to how exchanges operate and it would save you the fees that may accumulate over a large number of internal transfers.  
[/quote]  
  
  
Cool thx for the clarification.&nbsp; Ya storing the transactions internally until the final withdrawal sounds like the better idea. Will look into this.

---

<div class="post-metadata">

### Author: ![reader31](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@reader31](https://forums.counterparty.io/u/reader31)
#### Post date: [April 18, 2014, 7:52pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/5 "2014-04-18T19:52:21Z")

</div>

[quote author=xnova link=topic=265.msg1968#msg1968 date=1397709948]  
You should hook into the API for counterpartyd and optionally counterwalletd. Creating your own counterparty transactions manually is not recommended.  
  
  
API docs: [http://counterpartyd.readthedocs.org/en/develop/API.html](http://counterpartyd.readthedocs.org/en/develop/API.html)  
[/quote]  
  
  
This would require both counterpartyd and bitcoind running on my server correct?  
  
  
Can I also accomplish the same tasks by using the pyrpcwallet(light wallet)?  
  
  
  
  
Thx,

---

<div class="post-metadata">

### Author: ![robby\_dermody](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/robby_dermody/32/226_2.png) [@robby\_dermody](https://forums.counterparty.io/u/robby_dermody)
#### Post date: [April 20, 2014, 3:37pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/6 "2014-04-20T15:37:15Z")

</div>

[quote author=reader31 link=topic=265.msg1989#msg1989 date=1397865141]  
[quote author=xnova link=topic=265.msg1968#msg1968 date=1397709948]  
You should hook into the API for counterpartyd and optionally counterwalletd. Creating your own counterparty transactions manually is not recommended.  
  
  
API docs: [http://counterpartyd.readthedocs.org/en/develop/API.html](http://counterpartyd.readthedocs.org/en/develop/API.html)  
[/quote]  
  
  
This would require both counterpartyd and bitcoind running on my server correct?  
  
  
Can I also accomplish the same tasks by using the pyrpcwallet(light wallet)?  
  
  
  
  
Thx,  
[/quote]  
  
  
Yes, you would need counterpartyd and bitcoind running. Easiest way to get all that up may be to set up the server as a federated node (which is how we run the counterwallet servers), see: [https://github.com/xnova/counterpartyd\_build/blob/develop/docs/SettingUpAFederatedNode.rst#node-setup](https://github.com/xnova/counterpartyd_build/blob/develop/docs/SettingUpAFederatedNode.rst#node-setup)  
  
  
[font=Verdana]Then, you could just stop/disable counterwalletd from running, and host your stuff already. (or, you could keep counterwalletd running…it has a pretty powerful API that may provide some useful functionality to you over what counterpartyd does).[/font]  
  
You could use pyrpcwallet I’d think, instead of bitcoind… I haven’t done much with it, but it’s Ouziel’s (JahPowerBit’s) baby, and he’ll be able to answer questions about it.  
However, if you are providing a service to other users, I would definitely run bitcoind directly, for security and stability sake.

---

<div class="post-metadata">

### Author: ![reader31](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@reader31](https://forums.counterparty.io/u/reader31)
#### Post date: [April 21, 2014, 3:14pm UTC](https://forums.counterparty.io/t/handling-counterparty-assets-in-my-webserver/238/7 "2014-04-21T15:14:54Z")

</div>

great thx for the clarification. I would look into setting up a federated node.
