ZeroNet Apps with Counterwallet Addresses

##Introduction

Previous posts in this series:

As we can see in the second post, the use of Counterwallet address rather than random address can simplify your ZeroNet management. But the sample site we created was a Hello World type of site, so in this article I will focus on practical use of ZeroNet sites based on Counterwallet address.

##ZeroNet Site and App Concepts

I explained those in the first and second article, so I’ll continue from there:

  • Sites can be copied - that’s how they’re seeded in the first place - so for any site that you visit, its contents will be copied to data subdirectory of your ZeroNet base directory. For example, if you visit http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D, you’ll see a new directory data/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D
  • To create a clone of that site, you can use one these approaches:
  • Create a new site using a Counterwallet address (see the second article above) and copy desired contents to that site’s folder. A disadvantage, we could say, is that you will have one site (and need one Counterwallet address) per each “app”, because 1 app = 1 Zeronet site = 1 bitcoin address.
  • Merge contents of some existing site into a subdirectory of your “Hello World” site (if you want to have multiple applications in one site). This may involve some messing around with file paths and links.
  • Once you’re done, stop zeronet service, publish, and start zeronet service again (see the second article above).

Some sites may lend themselves nicely to cloning, especially if they use relative paths - in the first ZeroNet article I showed how CounterTools can be unzipped to your skeleton site without any changes whatsoever.

##CLI and GUI Cloning

  • Sites can be cloned in the CLI (more on that below), but some can also be cloned through the Web UI.
  • Visit the “home” page of ZeroNet and find a clonable site, such as ZeroBlog, right-click on the accordion menu and select Clone. At the moment you need to actually visit the site first, return to the home page, and then clone it.

This is because you can’t clone it unless it’s been downloaded. Maybe this restriction will be removed in a future release.

  • A clone site will appear in your browser where you can edit it directly. Or you can do that in the CLI (data/<NEW-ADDRESS>; you can see the address in your browser - 14o5…`), but remember that any change through the CLI requires the site to be republished and zeronet service restarted.

Summary of steps required for a new ZeroNet site:

  • Visit a site you want to clone
  • Create a new site using a dedicated Counterwallet address without Counterparty or BTC funds
  • Copy the cloned site’s content to your new site

##Seeding

Like with torrents, you are the initial seeder of your own site(s). Until you have another visitor, you’ll remain the only seeder.

This means that your site will be accessible only as long as your zeronet service is up, or at least one other online visitor has the latest copy of your site (maybe older copies will work as well, but they would contain outdated content).

##Making Adjustments

Because Web-based cloning creates a new random bitcoin address on the fly, if we wanted to use a Counterwallet address, for Web-based cloning we’d create a new site (the second article above) and copy the contents of the cloned site to the new site.

$ cp -pr data/<RANDOM-BITCOIN-ADDRESS-OF-CLONE-SITE-YOU-CREATED> data/<YOUR-COUNTERWALLET-ADDRESS>

For multi-app sites, as explained above, you’d probably want to create an app directory such as data/<YOUR-COUNTERWALLET-ADDRESS>/blog copy your cloned ZeroNet blog to that directory and perform any modifications (fix links, add menu items, change CSS…).

Some changes - such as background color - can be made in content.json which is located in your site directory:

{
 "address": "14o5DhK919v9zFbkeF8JHwcN7THtSqSWQe",
 "address_index": 47117890,
 "background-color": "white",
 "description": "Blogging platform Demo",
 "files": {

Some currently available ZeroNet applications include:

  • Blog
  • Forum
  • Web site

Any static site or your content can be used as well.

##Next Steps

WIth ZeroNet your presence is limited to ZeronNet. While there are Web2Zeronet gateways, they aren’t guaranteed to be online at all times.

If you’re a Counterparty asset issuer who doesn’t have Web presence, the question is how can anyone find your Web site.

You may want to use Enhanced Asset Info to provide a link to your official ZeroNet URL. CoinDaddy.io and other sites provide paid asset enhancement services.

As mentioned in previous text, you probably don’t want to use your asset issuing Counterwallet address for your Zeronet site address because if that private key leaks, your asset can be transferred to anyone. A better way is use your Counterwallet pass phrase to generate one dedicated new address for ZeroNet site use, and then broadcast that address from your asset-issuing address.

ZeroNet offers the same level of anonymity as BitTorrent. IP addresses of publishers and visitors are known, although visitors are somewhat less exposed to the owner once there are more seeders. If you need to better privacy, you can access ZeroNet through Tor.

##Conclusion

This how-to shows how to create asset/token based community for Counterparty asset owners.

Because ZeroNet makes it possible for users to register using their bitcoin (i.e. Counterwallet) address, asset owners can use ZeroNet to interact with their asset holders. Based on the same precautionary principle of not using your token-holding address for ZeroNet access, users should probably use a dedicated address and verify it by broadcasting it from their token/asset-holding address. This will be topic of our next Zeronet tutorial.


Keywords: zeronet, counterparty, counterwallet, p2p