ZeroNet and Counterwallet addresses

Couple of things related to the nice ZeroNet project… It’s basically a publishing platform that uses Python, bitcoin addresses (no bitcoin transactions, these are used for ID’s only) and BitTorrent to create a P2P distributed content network.

  • When one creates a site, Zeronet uses a bitcoin address generator to create a “site” ( https://zeronet.readthedocs.org/en/latest/using_zeronet/create_new_site/ )
  • Every time one updates the site, content needs to be signed using the private key of the owner’s Bitcoin address (see example on the same page above)
  • Zeronet sites can have per-site registration and one’s nickname is tied to additional per-site addresses (example below is for zeroid.bit). These are separate addresses, one per site, generated from a master seed unique to each user.
  • .bit (Namecoin) domains are optional “aliases” for bitcoin addresses; here I’m using one such alias instead of a bitcoin address
 "certs": {
      "zeroid.bit": {
        "auth_address": "1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "auth_privatekey": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
        "auth_type": "web",
        "auth_user_name": "nick",
        "cert_sign": "sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss="
      }

  • Another potentially interesting option is to include another contents.json file:
{
  "data/users/content.json": {
    "signers": [ # Possible signers address for the file
      "1LSxsKfC9S9TVXGGNSM3vPHjyW82jgCX5f";
      "1GxsKfC9S9TVXGGNSM3vPHjyW82jgC143f"
    ],
    "signers_required": 2 # Valid signs required to accept the file (Multisig possibility),
    "files_allowed": "data.json", # Preg pattern for the allowed files in the include file
    "includes_allowed": false, # Nested includes allowed or not
    "max_size": 10000, # Max sum filesize allowed in the include (in bytes)
  }
}
  • Rules of allowed user content of current directory:
  "user_contents": {
    "cert_signers": {
      "zeroid.bit": [ "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" ]
    },
    "permission_rules": {
      ".*": {
        "files_allowed": "data.json",
        "max_size": 10000
      },
      "bitid/.*@zeroid.bit": { "max_size": 40000 },
      "bitmsg/.*@zeroid.bit": { "max_size": 15000 }
    },
    "permissions": {
      "disallowed@zeroid.bit": false,
      "good@zeroid.bit": { "max_size": 1000000 }
    }
  }

Ref: http://zeronet.readthedocs.org/en/latest/site_development/content_json/

Counterparty-Related

  • User can broadcast his Zeronet site address using his Counterparty/Bitcoin address to establish one-way or two-way link between identities. Because Zeronet user has access to the private key used to sign site updates, it is easy to broadcast from that address.
  • In that way is possible allow site access to holders of certain CP assets, but unfortunately user identity is different from site identity - there is one per-site - and uses a separate (new) Bitcoin address. That is, Zeronet users have an address, private key and nick combo for every site where they choose to register. It would still be possible to use the broadcast approach described above, as long as one doesn’t need to register at too many sites. For example, if all sites allowed users from zeroid.bit, then it would be economical to use this approach.
  • With a little bit of scripting one could create interesting scenarios for multi-user sites.

Zeronet Presentation and Web Gateway

Example of a ZeroNet site created by simply unzipping @JPJA’s CounterTools to a directory.