Migrate virtual machines using LVM without access to hypervisor

I decided to migrate a few virtual machines from one hosting service to another. Most other howtos either recommend a reinstall or need access to the hypervisor (KVM/libvirt in this case – I could use native migrate functionality), which I did not have. Of course, you need to make sure you have the same architecture (x86_64 in my case) and it is probably wise if both source and destination run on the same virtualizator, so the devices are correct.

I was using Centos 7.6 virtual machines. The target machine was booted into System Rescue CD, selected from the operator’s dashboard. The exact steps will be different if you use different OS.

Let’s start. On source and target, make sure there are a few utilities needed. The yum command is not required on target if you run System Rescue CD

yum install pv pigz nmap-netcat rubygems
gem install lvmsync

On System Rescue CD, you need to either add lvmsync to PATH or link it to /usr/local/bin. This is a one-time operating system, so don’t get too cozy, everything will be gone after reboot, so no need to do things “nicely”.

The plan

On the source machine, I use LVM, in one case also with LUKS and cryptsetup (hosted on LVM volume). We will recreate the same structure on the target machine. My particular structure is default Centos7. My virtual hard drive is /dev/vda (if it is not on target, check that you are using virtio, otherwise the machine will be slow). /dev/vda1 is ext4 boot partition, /dev/vda2 is LVM volume.

Since the copying can be slow, I will copy the boot partition, create a LVM snapshot of any other volumes, transfer the snapshot while the source machine is doing it’s job, then use lvmsync to sync the changes, thus minimizing downtime. Then I setup the bootloader, change network settings and optionally do a portforward on the old machine, to compensate for slow DNS propagation.

Recreate partitions

You can use fdisk or parted to recreate partition table on the target machine. I used

fdisk /dev/vda

I created the /boot partition on /dev/vda1 with the exact same size as on the source machine (fdisk -l /dev/vda on source). Then I created /dev/vda2, which was a little bit larger.

I recreated the volumes as they were – volume group name was vg0, I had two logical volumes: root and swap. Use vgdisplay and lvdisplay to understand your exact situation

Then on target:

# create physical volume, add it into a newly created volume group
pvcreate /dev/vda2 
vgcreate vg0 /dev/vda2
# create and initialize swap
lvcreate -L 4G -n swap vg0
mkswap /dev/vg0/swap
# create and initialize root volume, make sure the size is at least the source size
lvcreate -L 50G -n root vg0

Copy the /boot partition

Setup networking on target (System Rescue CD), make note of your IP address.

Then prepare for receiving on the target machine. Replace TYPEASTRONGENCRYPTIONPASSWORDHERE with some random password you will use for the transfer:

nc -l -p 444 | openssl aes-256-cbc -d -salt -pass pass:TYPEASTRONGENCRYPTIONPASSWORDHERE -md sha256 | pigz -d | dd bs=16M of=/dev/vda1

Note that we don’t use SSH, it is slow with buffers, it would take ages, especially the large volumes.

On source machine, first remount /boot read only, transfer and then remount readwrite. Change the IP address of the target:

mount -o remount,ro /boot
pv -r -t -b -p -e /dev/vda1 | pigz -1 | openssl aes-256-cbc -salt -pass pass:TYPEASTRONGENCRYPTIONPASSWORDHERE -md sha256 | ncat TARGETIP 444
mount -o remount,rw /boot

The pv command will give you a fancy progress bar with ETA, neat!

After receiving on the target, just check the filesystem

fsck.ext4 /dev/vda1

LVM snapshots

Now the funny part, creating the snapshot and copying.

This plan can work only if you have some free space in volume group. In one case I used an ugly hack, but that could backfire. Snapshots are thin and only require the amount of space that would cover all the writes between the time the snapshot was taken and now. I did not have space on one machine, so after transferring /boot partition to the target, I deleted few old kernels from it and used it as a volume (losetup, pvcreate, vgextend – I am not writing exact commands, you really should understand what you are doing here). Warning – only do this on partitions that are not part of LVM!

Assuming we now have space in volume group vg0 on source machine, let’s create the snapshot:

lvcreate --snapshot --name transfer_snap --size 1G /dev/vg0/root

This snapshot does not have to be consistent, you can do it while the machine is doing everything. Check from time to time if the snapshot is not running out of space using lvs command.

Prepare for receiving on the target (we only changed the destination block device to /dev/vg0/root, no snapshots on the target are required):

nc -l -p 444 | openssl aes-256-cbc -d -salt -pass pass:TYPEASTRONGENCRYPTIONPASSWORDHERE -md sha256 | pigz -d | dd bs=16M of=/dev/vg0/root

Now send over the snapshot from source, changing the TARGETIP:

pv -r -t -b -p -e /dev/vg0/transfer_snap | pigz -1 | openssl aes-256-cbc -salt -pass pass:TYPEASTRONGENCRYPTIONPASSWORDHERE -md sha256 | ncat TARGETIP 444

This can take a long time, go and enjoy some movie. If there are more volumes, repeat.

Now make sure you have lvmsync installed and in path on both source and target. Also make sure you can ssh from source to target as root (in System Rescue CD it only involved setting up the password using passwd).

If you tested everything, now is the time to do some shutdowns. Use systemctl to shutdown a webserver, database server, if you use Bitcoin lightning, make sure to shutdown lnd or anything else that could make the system inconsistent. This will hopefully be brief, but let’s hope it’s 4am and no one uses the server anyway:).

Then run the sync on source, replace target IP with the target’s IP:

lvmsync /dev/vg0/transfer_snap TARGETIP:/dev/vg0/root

It will ask for root’s password on the target and sync the changes.

Bootloader and networking

Now we will check the filesystem and setup bootloader on target:

fsck /dev/vg0/root # you might invoke a particular fsck for your filesystem type
mount /dev/vg0/root /mnt
chroot /mnt # after this, we are in the context of the target machine
mount -t devtmpfs dev /dev
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount /dev/vda1 /boot # make sure grub sees the correct boot partition
/usr/sbin/grub2-install --boot-directory=/boot /dev/vda
export PATH=$PATH:/usr/sbin
/usr/sbin/grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)" # especially this part is Centos/RHEL specific. On ubuntu, you would do something like update-grub

Now, the last part is checking the network settings, change /etc/sysconfig/network-scripts for your ethernet adapter and make sure you have the correct network settings.

Then still on target:

umount /dev
umount /proc
umount /sys
umount /boot
exit # from chroot
umount /mnt
reboot

Forward ports

Hopefully, you have a nice new machine that booted and everything works (if it booted, there’s a good chance that it does, unless you forgot old IPs somewhere).

We need to change any DNS entries to the new machine. I prefer testing out the new installation without changing DNS. On the old source machine:

yum install socat
# let's forward 80 and 443, leave this running in screen
socat -d -d -lmlocal2  TCP4-LISTEN:80,reuseaddr,fork,su=nobody TCP4:TARGETIP:80 &
socat -d -d -lmlocal2  TCP4-LISTEN:443,reuseaddr,fork,su=nobody TCP4:TARGETIP:443 &

Now test the website or any other services. If you are happy with it, change the DNS, keep the socat running, so the web works for those who have cached the old IP address.

The last thing to do on the old machine to cleanup is to make sure the web/database/lnd/… don’t start again (use systemctl disable) and delete the snapshot, otherwise the volume group would probably run out of space soon:

lvremove /dev/vg0/transfer_snap

The end

I hope you enjoyed this tutorial. What I especially like about this approach is that it is completely from “within” the machine, except for booting System Rescue CD on target which most hostings allow you to do.

I liked learning about lvmsync, pv (the piped-progress bar that I will use for everything from now on), pigz (parallel fast piped gzip), openssl passthrough encryption (which is way faster than SSH, because of buffers) and relearning socat again.

The downtime was very short, the services were down for the time between starting lvmsync and rebooting (after installing the bootloader). In one case I had to reinstall the kernel package.

Hope you had fun, if you found this tutorial useful, please head to Support me page and send me some crypto-love!

How to use cryptocurrencies for discounted shopping on Amazon

Many people ask me how a “normal” person can use cryptocurrencies for something, that is not possible without them. One of such uses is using a service called purse.io to shop for almost anything on Amazon using cryptocurrencies while getting up to 33% discount. So daily shopping for less, yay!

I made a video howto on how to exactly do that. If you use my referral link, you’ll also get additional bonus after you do $100 in orders.

Solution to crony capitalism?

When I first heard about a new episode of Econtalk with Michael Munger (and the Econtalk host Russ Roberts), I didn’t pay attention to the title, I just new it has to be great as all of their conversations. I had a chance to see Michael Munger live at SREK – Seminar of Austrian economy in Slovakia that is organized by INESS.

Short summary (but go listen to the episode): An entrepreneur invests energy and parts of profits to increase the quality of the product – higher quality, improving the manufacturing process, hiring better people or lowering the prices. At some point, it is no longer profitable to invest additional money to improvement, but to invest additional dollars in buying politicians, paying think-tanks to suggest new regulation and get involved in rent seeking or raising the barriers of entry for the competition. This practice is simply a fact of economic reality in most societies.

Crony capitalism (as this practice is known) has various forms in different countries. In Europe, it might be a guy in leather jacket, driving Bentley handing of a suitcase full of cash (making it an illegal transaction because of the limited use of cash in most of Europe) to a politician or a representative of a regulatory body. In some more extreme situations, they would flatly create a political party that would be just a proxy, channeling cronies’ regulations directly to the parliament and voting for it. In some countries, these are “discussions” between “our representatives” and “members of a particular industry” in order to “improve quality” or stop global warming. You usually “improve quality” by requiring stamps, certifications, use of hard-to-acquire materials. But mainly there is a costly bureaucracy that would make it very difficult for any potential newcomer to go through the same pain. Think GDPR. Then your wanna-be competitors cannot just disrupt your business, they have to invest first and then fail.

One of the aspects is exactly this – the cost of failure is too high, so entrepreneurs want to assure success by changing the rules of the play.

Solution to crony capitalism

I’ll start by which solutions don’t work. The first one is obvious – as our culture improves, the people improve and their morality would improve. When hundreds of years ago, it was OK to enslave another humans, now it is not. It does not mean it does not happen, it means, that in a current cultural climate, almost no one would say that this is a moral thing to do. So it only happens when “outsiders” do not know it is happening, but still, it is happening much more rarely.

So the solution would be: Make sure that we all consider crony capitalism immoral and the culture changes. Note the use of words: immoral, because it often is legal.

This essentially means that we will fix cronyism by removing it from capitalism. How? By changing the people involved.

But wait, that sounds awfully similar to how the problems of communism are “solved” (rhetorically, never in practice) – we will first upgrade the human race to only take what they absolutely need and then anyone can take anything. It never worked and never will, because the non-compliant behaviour is the most rational one. It won’t fix cronyism either.

The second one is legislating it away – passing laws that would make it illegal to influence regulations.

This is the place where I should let Jennifer Lawrence talk about this solution:

The problem with this solution? It is already illegal in many forms and in many countries. Yet, it is still happening. Legislating away did not work for drugs, weapons, alcohol during prohibition. Legislating greed away did not work in North Korea. Underproduction in non-profitable scenario is “highly regulated” (to put it mildly) in Venezuela. But you cannot escape the economic reality.

To be fair, you can fix some problems, mainly repealing or liberating regulation. Nixon created war on drugs. Now it is being fixed by repealing the laws, exactly how Jennifer Lawrence puts it in the video above – state by state, reaching critical mass and fixing what Nixon broke.

This problem does not usually work for corruption. Direct bribery is illegal almost anywhere. As are a lot of other things. I live in Slovak Republic. We have one of the most transparent and liberal Freedom of information act. All contracts with government entities have to be public, or they cannot be enforced. We are transparent, yet a year ago, a journalist writing about corruption scandals was murdered in his home, with his fiancee. It seems that the lover of then prime-minister had frequent and close contact with her ex-lover, incidentally working for Italian mafia. The Italians were apparently in close contact with the chief of secret service.

Culture change is slower then politics, it works very rarely. I am not denying the fact that culture and legislation can lead to better or worse effects. I am saying that this change is slow and it does not always go in one direction. Does it really matter that much whether the bribe comes from a 90s-style dressed mafioso on an awfully expensive Bentley or by a wire transfer from a Saudi hedge fund as a donation? Or through producing thousands of pages of paper in some non-governmental regulatory body sponsored by [insert your favourite cronyist megacorporation here]?

Parallel societies

Many of you know we are experimenting with parallel societies. We started Parallel Polis – a crypto utopian house that runs on cryptocurrencies, open-source music, our own morality and justice and our common goal of growth of us as people and also as entrepreneurs. We are building a parallel society now, it is not a future-utopia project, it exists and you can start your own.

This approach combines two of the above solutions in a unique way that makes it work. First, there is a common (shared) morality, where we all agree that cronyism is not a way to go. How do we do that? Well, people have many opinions on this topic, from agorists (“let’s steal from the state, it will go bankrupt sooner”) to progressive democrats. But people that are a part of our parallel society, cannot be part of our culture, if cronyism is how they grow their business. Our values are very clear and the role models in our culture do not go to meetings with politicians, however well-intentioned they might be.

We’ve been criticised for that, because what looks like a lobbying can be just an honest attempt to make the world a better place. We have a more impactful way to make a world a better place.

The grassroots change that Jennifer Lawrence talks about has a very interesting property. The impact of change drops exponentially with the distance (distance being social distance in a network of society). You can be a huge positive influence on the 150 people around you, you can make a small change in thousands around them and your impact is negligible on a national or world scale.

Impacting our life positively does not go much further beyond our own “Polis”, the smallest unit of society larger than a family, or a “city”. Polis in ancient Greece were much smaller than today’s cities. I live close to Vienna, our impact is close to zero there. But in Vienna, there is Riat, another form of parallel society, with similar values. There’s Prague Paralelní Polis. There are new ones being created right now. Some are more like clubs, some are co-living spaces, some are virtual, some are physical. One thing should be clear though – our positive impact is for us. Meaning – we are not trying to change anything with those that don’t want to be part of our society. We are not “let’s change everyone” society we are “those that can change are welcome to join” society.

And that’s how you change the world – create something that is extremely beneficial for those that want to be part of it. If you don’t know how, start by fostering private interactions, don’t hestitate to switch among being inspired by people around you, work with them, create companies with them, grow together. These close interactions within a common freedom-based culture have an unbelievable effect. In some cases, it is an intense ride that is not for everyone. In other cases, it is just a closer group of people that like to spend time together.

Create it in a decentralized, non-hierarchical way, meaning if someone does not agree with you, or if they want things to be a bit different, they are free to turn their vision into reality by creating another parallel society. These are not competitors, they are parallel experiments. They accelerate our learning, like adding a new processor core to a computer.

Did I just invent this? No, the idea is popping back over and over again. Many people have learnt that fighting evil is not the best strategy. Building the solutions that solve the problem is.

“A lot of people don’t like the idea, because it requires effort and because they’ve been seduced by the big lie of democratic politics, which is this:

If you can complain well enough, the machinery of the state will create what you want.”

– Paul Rosenberg in Fighting Evil Is a Failed Strategy

We can become a society of small parallel societies, where the cronies won’t matter, they and the politicians would think they have a job, but most of the interactions are among the members of the parallel society. They will evaporate like Rome, without putting down the flag, just fading into irrelevance.

You cannot easily change culture, but you can choose culture.

Sharing files using send.firefox.com

Sharing files has been an issue. There were several services for that, I mainly used transfer.sh and dropbox/google drive. Now that Mozilla Foundation launched send.firefox.com, I switched to it. It is not as easy as transfer from the command-line by itself (you cannot upload files through curl for example like with transfer.sh), but there are ways around it. First, why?

Send.firefox.com allows sending of files up to 1GB without registration. If you register, you can upload files up to 2.5GB. The main difference is, that the file is encrypted locally before sending. When you request the file back from the service using the URL, it is sent to you and decrypted locally, so the service does not see your files. You can add additional password protection.

This is problematic from the command-line though, but there is an amazing project called ffsend that allows using send.firefox.com from command-line. Install it (I used homebrew, so it was simple brew install ffsend). Then you can do something like:

ffsend upload --copy file.txt

This will upload the file and will copy the link to your clipboard. You can also download the file locally using

ffsend download 'https://send.firefox.com/download/f7f05a2ba8/#LhWgdHFEvC8wxjVPtVt_6A'

I also updated my dotfiles to include this new service for the transfer alias.

EU banking blacklist not approved!

I don’t often praise EU, but let’s give credit where credit is due. The stupid “dirty money blacklist” of several US territories, Panama and Saudi Arabia didn’t go through. Vera Jourova credits mainly lobbying of these countries, I hope there was some sanity on the side of the EU member states involved as well.

Panama has signed all the international tax treaties (like OECD CRS), there has been no public case of aiding money laundering by a Panamanian bank (contrary to a few German and Luxembourg banks for example).

What is important to understand that this has _nothing_ to do with Panama papers. Panama papers was about offshore jurisdictions (i.e. having a company in Panama a moving money to the Panamanian company). But a Panamanian company can have a bank account wherever a bank would open one (Juncker has been investigated by the EU that he allowed Panamanian companies to launder money in Luxembourg while he was a prime minister – meaning, the money actually never left EU, they stayed in Luxembourg banks!).

Panamanian banks do probably the craziest and most thorough KYC/AML I have ever experienced and I think they are doing sometimes too good of a job. I highly doubt that with the difficulty of sending wires through correspondent banks, it would be possible to launder any money without the knowledge and aid of US-based correspondent banks, because they are _required_ for any dollar transfers. Panama uses US dollar and all international wires have to go through FED registered bank.

Front-running on content platforms with market – case study of yours.org front-running bot (part 2)

In previous part, I shared what is interesting about content sharing networks that incorporate direct market mechanisms such as upvoting, tipping, paid comments and paid content (paywall). In this part, I will focus on upvoting, because it allows people other than content creators to discover and invest in great content and make money if they are right. I will share my experience and code of a front-running bot (running on yours.org) that does this semi-automatically.

Remember this picture:

In the votes section, you can see how the voting system works. The last person to vote pays 25 cents and they are distributed among the previous voters. Here, the previous voter earns 23.9 cents, the one before 22.8, etc. In this distribution, the first quarter always makes money (sometimes more than first quarter, if someone votes more than once). So here, there are 24 voters, so the first 6 will always make money. The first vote is “free” and it is given to the author of the article.

What is front-running?

The term originates from the era when stock market trades were executed via paper carried by hand between trading desks. The routine business of hand-carrying client orders between desks would normally proceed at a walking pace, but a broker could literally run in front of the walking traffic to reach the desk and execute his own personal account order immediately before a large client order.

Front-running normally means using or even abusing an information that is not public, but has since been used more widely.

This topic is especially important in blockchain based systems. Imagine there is something as a “market order” executed on the decentralised exchange settled by smart contracts. “Market order” means “I would like to by X amount of an asset Y, whatever the price might be”. Now imagine you see this order in the mempool, before it is mined into a blockchain. Yes, you guessed correctly, free money. You put a limit buy order and a limit sell order, pay higher fee to be included in the blockchain before the poor guy’s market order and you made a profit. If you are a miner, you can do other things, you can reorder transactions however you like, so in the case you understand the underlying smart contracts and transactions, you are in for an additional treat.

To be honest, most current blockchain applications try to combat front-running. ENS (Ethereum Name System) does blind auctions. Most DEXes only support limit orders, not market orders.

Investing into content – is it front-running?

So am I doing front-running? Not in a sense that I know something that others don’t – I don’t. What I do is I guess what articles are successful and I put my vote as soon as the article is out and noticed by humans. And there’s someone that is more capable in doing that than me – a machine. So if I wanted to bet that a drawing by Satoshi Doodles is going to be successful, I’d rather be among the first in the row – because the first quarter makes money.

I am not front-running on any information that is known only to me – everyone loves Satoshi Doodles. But so do people like the writings of Craig S. Wright, which honestly half of the time don’t even make any semantic sense, he usually writes like a high school essayist, trying to convey a “controversial” idea by touching on things that the reader would not understand, because they miss the context. I don’t know why, but Craig S. Wright gets upvotes too and I invest in his articles, because I want to make money, not because I like them (contrary to Satoshi Doodles, which I like).

So picking the right authors is not about picking what I think is good, but what other people might consider good content (a Schelling point). It is a form of popularity contest, where you are rewarded more if you conform with the masses among the first. I am front-running the mass opinion. In this sense, it is contrary to front-running, because I am extrapolating on publicly known information, not using unknown information.

What are the technicalities?

The way yours.org works is that they do Bitcoin Cash SV transactions on-chain for every vote. So if I click on vote and pay 25 cents, these 25 cents are sent on-chain to all the previous voters. I used to make fun of people who were complaining that I pay on-chain for coffee in Bitcoin Coffee (part of Paralelná Polis). I would show them some of the 20KB transactions distributing fractions of a cent on-chain for an article vote. It would always make them crazy.

In order to do the vote, I have to interact with the platform directly. It contains BSV JavaScript wallet that distributes the funds and also receives profits from tips, upvotes and other ways to make money on the platform. So I decided the best course of action would be to use a headless scriptable browser that would make it easy for me to interact with the platform without needing to do any transaction signing, etc.

I picked puppeteer, mainly because it is developed by Google Chrome team and it is fully scriptable Chrome browser. I guess yours would always work in Chrome, so that would make it a nice long-term solution. That also means that unless the platform is significantly changed on the outside, it would follow all the upgrades of the backend. I didn’t need to change a single line of code after the fork from Bitcoin Cash to BSV. I was merely clicking buttons, I only had to get some BSV tokens, which I didn’t have, because I got rid of all BSV tokens after the fork (which turned out to be a great decision, paid for a coffee or two).

I wanted to discover the best strategy, but what was important is that I didn’t want to be a jerk to the operators of yours. I implemented very sane delays in order not to put unnecessary load on the server infrastructure of yours. Also, I realized that a lot of the work is done by the client in JavaScript. What I also realized is the fact that if a user votes more than once, he is at a disadvantage, because previous votes don’t get a cut from the 25 cents. This is simply not a good solution and I created two more accounts on the platform which the bots also use, but not in parallel.

This is not a high frequency game, there are people voting and they are slow. Also, I don’t really need to be first, I need more to be under the radar, so the operators don’t implement some CAPTCHAs (which are BTW very easy to go around these days – AI has become better than us in CAPTCHAs and you can buy services to go around them).

Next was picking of the authors. I went through the front page and found people who were consistently upvoted. I won’t share my list, but if you are on yours for a while, these are the usual suspects. A development update here, some news from the crypto world there, good commentators and even some crazy people that are building a following. After the fork, the platform had a reduction in users and I realised that I am deciding the content on the front page. It cost me two dollars (that’s the investment budget that I put in after the BSV fork). Most of the budget is returned to my other accounts. Why? If an author writes an article and my three puppet users vote on this article, there are four voters (the author gets the first vote). The cost of first user is 25 cents (it all goes to the author), the second user pays me back 12.5 (through the first account) and the third user pays a bit to both. So while it’s true that I pay 75 cents, I get immediate refund of around 30 cents. Then every user that votes (maybe because they find the article on the homepage – this is usually enough to get a user on a homepage) pays me back.

Was it worth it?

Did I earn the cost of my time back? No, I haven’t. Being an entrepreneur, this is a very low return strategy for me. The fact is that I love programming, so I enjoyed the time invested in thinking about this and actually making it happen. And if there are content networks that implement market principles, I wanted to be among the first that make use of these markets and I wanted to make them more efficient at discovering content. There’s an interesting positive feedback loop – what is popular is what I make popular. And I make popular what would probably be popular. Positive feedback loops can be used in many areas of life.

I didn’t make money on all posts – not by far. But before the fork, it paid for one or two sushi dinners per month. Thankfully, there was a portal that allowed me to order sushi paying with BCH that I made directly using Bitpay – I bet those were the largest (in kilobytes) transactions they’ve ever seen.

I also wanted to play with direct on-chain applications and I decided to combine it with a small dopamine injection, so I wrote a program that would withdraw the money I made once a week to my wallet. It happened on Sunday and it was my small celebration, although it did not happen every week, some weeks, my investments lost money. I didn’t redo this script for BSV, but I guess it could now be used on honest.cash which uses BCH ABC.

Conclusion

Some comments on the first article was about what is the best coin, how shitty is BCH ABC / SV, or “insert-my-coin” is the best. I don’t care, that was not the point, the point was that there is a way to reward content creators and people who discover content, that cryptocurrencies make a great part of this infrastructure (otherwise authors from crazy dictatorships like Venezuela would not be able to receive any money – and they can really make a living out of writing high quality content).

I really like yours.org as an experiment in this regard. There are several problems with the approach of yours – by making it easy for someone to promote their own articles (opening several accounts and upvoting is basically free – there are only some small fees and one could be on the homepage for a long time). The difference between several votes on one article by one user and more users does not make too much sense (anyone can create more than one account). Other than that, I have certainly learnt a lot about how these markets could operate and what emerges when you create a market structure based on content.

I wish yours.org, honest.cash and other such platforms all the best and I hope we have not seen last of those.

The code

You can find the code on my github. Please note that this is an unsupported software and it might stop working at any time with any change on the side of yours.org. Also, it is probably my first JavaScript outside of basic HTML, so it is not pretty.

Before you go

If you like my writing, please note that I am currently working on a book called Financial Surveillance and Crypto Utopias, where I explain what happened to banking secrecy, how the current payment networks are regulated and how crypto can solve these problems, thus creating the unique value proposition for cryptocurrencies. Other peoples’ mistakes are the best value proposition for competing projects and this is the case for old-school financial sector vs cryptocurrencies. Read more about the project and sign up for updates and releases here.

Paid content networks – how to get rewarded for creating content, a case study of yours.org (part 1)

One of the main problems that many people have with the Internet is that is free. Of course we all love free stuff, but is it really free? No, we just don’t pay for it, because advertisers do. The problem is that people create useful content that is then used to attract attention of other people. The content creators are suckers that create content and distribute it for free, while a shampoo ad is displayed alongside the work of a blogger, creative writer or journalist. Let’s think about this for a while. It is increasingly difficult to get attention of people, everyone wants our attention. Our smartphones are filled with notifications. When I accidentally turn of ad-blocker and look at the web, I want to puke, it looks like a cheap flea market filled with ads for products that I am not interested in. Some companies are better at targeting ads, but still – if I create something useful, how do I get paid? Well, I pay to get noticed to the same companies that focus the attention of my customers somewhere else. The authors always have to bundle their writing with something else – subscribe to a mailing list to get a free e-book. Traditional subscription paywalls don’t work either. If I want to read a good article in an online portal once a year, I don’t want to subscribe, because I don’t care about most of the articles.

There are several models that could fix this problem. One of them is “Spotify” model – you pay subscription fee to a corporation and the authors are rewarded in proportion to what articles their clients read. The advantage of this model is that the customer have a fixed monthly budget and don’t need to care if and what they read – they have universal access.

Another solution is micropayments and I am going to look at this in more detail, in particular with now sadly dying platform yours.org. Yours had a great idea – let’s integrate cryptocurrency payments and content and reward content creators with cryptocurrency. Content creators in this case create blogs, so it’s essentially a blogging platform, but the content can be graphics. There are several ways how content creators can be rewarded.

Screenshot of my profile on yours.org
  • First, you can send tips to any author. It is integrated through their profile page. If you like something, you click on a button. Yours creates an onchain transaction with cryptocurrency called BSV from your browser, so the transaction is peer to peer, you do not need to “withdraw” anything, you are sending cryptocurrency directly to the wallet of the author.
  • The authors can put part of the content behind a paywall, meaning the blog can consist of free and paid part. This model is pretty common these days, although usually paid for by subscription fees, not an author-set reward. If you want to create an analysis, you can provide a free sneak-peek and a paid part that the platform only shows you when you pay the fee set by the author (the platform takes a small cut, but again – the payment goes directly to the content creator, no intermediaries).
  • One of the common problems is comment spam. People feel they are entitled to an opinion, which essentially means that any platform that is actually used is filled with trolls, lols and comments that don’t add any value. Content creators on yours can set a fee for posting a comment. If some user decides to comment, they pay a small fee (usually 10-25 usd cents), but if the comment is useful, they can get a tip (and they often do).
  • The last and most important way is that you can vote for content. One vote costs 25 cents (fixed fee, you cannot change that) and is again paid in BSV. The original author has a free first “vote” and all the payments are distributed among the people who have voted before the latest voter. So if I post this article on the platform and someone votes for it, I get 25 cents. If there’s a second paying voter, he pays 25 cents, I get 12.5 cents and the first paid voted gets 12.5 cents.

A business case for voting

Let’s talk about the last mechanism a little bit more. I can make money writing content, but I can make money discovering good content, because if I find something new but obscure and it is worth people’s time, they will vote for it. In addition, I directly pay to the creator of the content when I discover it. So the author always gets paid with votes.

Let’s take an example. My favourite author on Yours is Satoshi Doodles, who creates nice artwork commenting on what is happening on the crypto scene. Note that it is not a “blog” per se, the content is a drawing. There is usually no paywall in the articles, so the author makes most of the money on tips and votes.

So, I like the author, I want to support the author, so when I discover they write something new, I want to vote for the content. Voting also means that the content has a more prominent place on the homepage of yours.org, so it means it will be discovered more easily and get even more votes.

If there is a new post and I click on the vote, the author gets 25 cents. If someone else taps in, we split the 25 cents (Satoshi Doodles and me). The next voter splits the money. You can see your voting balance at the end of each post (per vote, not per user, you can vote more than once):

Here you can see that I made 23.2 cents (that is I got back my 25 cents for the vote and earned an additional 23.2 cents). The sum of the votes is $5.50, you can also tip any amount you like, here you can see that the author got $10.85 in tips. And I can write a comment for 10 cents. There is no paywall in this post.

So by voting, you achieve several goals:

  • First of all, you support the original author, they always get a cut of the votes
  • Second, you can make a little bit of money by discovering content and supporting authors
  • Third, you help the content get noticed, because it is displayed more prominently on the front-page. You can also vote on your own content and it is pretty cheap to be on the front-page of yours these days.

Problems with yours

There are several small problems, one of them is that if you are voting for a content and you are the first, the votes are basically free. If you create two accounts on the votes, you can vote with $10 which easily makes it the first post on the homepage for a few days and you get most of the $10 on the author account. And you also make most of the money out of next votes. Yours tries to combat that by not distributing the votes among yourself (so if you click “Vote” twice, the second vote gets registered, but the 25 cents is distributed among the other voters). You can have any number of accounts though, so this is not really an issue.

The second problem is of course traffic. If you create good content, you most certainly can make some money. The website itself has around half million monthly visits, which is only 26-times more than my personal blog – for a blogging platform, that is basically noise.

The third problem of course is the use of cryptocurrency – and I am a fan of cryptocurrencies. With money, the most important thing is network effects. Yours used to use Bitcoin Cash and due to the fact that they’ve been doing on-chain payments in JavaScript from the browser, that was a good choice. The author has a pretty good information about why they could not use the Lightning Network, even though they were working on payment channels – one of the main reasons is that in order to receive money, you have to be online, which is not the case usually, even when I am sleeping, I want the voter in China to give me my 25 cents. The alternative is to be custodial of money until I log in, but that’s not something the authors wanted.

After the fork of Bitcoin Cash to Bitcoin Cash ABC and Bitcoin Cash SV, the platform was completely offline for days and then they came back with support of BSV, which has a smaller market cap and even less users. Also, parts of the infrastructure that was set up to combat network effects is not working to this day – for example if you want to fund your wallet with Shapeshift, it is completely broken, the button is there, but it does not work and gives wrong QR code. So onboarding new users is almost impossible, unless you are smart enough to register on an obscure exchange that lists BSV, which is 11th in the market cap ranking, you are out of fun. Also, the 11th position is very misleading, because the distribution is showing existing coins that will most probably never move, because people don’t know how to claim forked coins from BTC and BCH. BSV has around 2.5 transactions per minute currently and I suspect most of this is votes and tips through yours.

The whole story of the fork is very sad. You might or might not agree about the scaling vision of big blocks, but it had its place, there was a pretty good software infrastructure (yours, memo.cash, joystream, bitbox, …). But then it turned into a fight of egos. People had to pick sides. There are no really important technical differences between ABC and SV, it was a plain old boring power struggle and the winner is… other cryptocurrencies. If you can totally destroy a decentralized project because you could not agree on how to handle miniscule technical details, this is a way to do it. So yours picked the smaller currency (BCH ABC has 3.3x transaction volume, 2x market cap and 4x trading volume). In addition, the authors of yours handled this very badly – the site was simply frozen after the fork for days, with not even a sentence on the front-page about what is happening.

Network effects

In this part we looked how people could be rewarded for content. The main issue of course is network effects and with content networks, you have to create two or three – you need to have network effect of content creators and consumers, you need to support payment that all these people can use and you need to tap into the existing sharing and content distribution networks (like Facebook). Yours created a small community of creators and consumers and for a while, it was my favourite “social network” – I like the gamification, I liked the fact that I knew most of the authors by their past content and interactions and it was a pretty pleasant community, with occasional begging for money that made it to the front page. There were a few nice projects and charities launched on Yours, like eatBCH. There was a larger amount of Venezuelans who were making money by writing about their lives in Venezuela, posting photos and videos. There was technical analysis of crypto trading patterns, technical discussions.

On the monetary side of the network effect, at first, you could fund your wallet with credit card through coinbase, you could use any crypto through Shapeshift and of course you could use BCH, which is very controversial, especially in Europe, but it was still in top 5 and could be used outside of yours. Now these options are limited, the community is split and BSV will most probably slowly die, because it does not bring anything new or better compared to BCH, is much smaller and does not have enough of required infrastructure of exchanges, wallets, etc.

The sharing outside of yours could be better – share buttons that allow sharing on different social media, maybe a way to reward people for sharing good content would be a good idea. One of the problems for example was that Yours did not provide a good preview picture in OpenGraph for sharing on Facebook, so all the yours posts looked the same and were not attractive for clicking – even if the post contained an image.

Conclusion of part one

In this part we looked at an attempt to reward people for creating content called yours. The authors of yours are working on a project called Money Button, which could provide the same functionality for any website in existence, the only problem is the use of a fringe cryptocurrency.

In next part, I will look at the monetary aspects of yours and at my (successful) attempt to write a front-running script that would make use of the voting mechanism to pay for my sushi dinners with crypto. I wrote a lot of code that I am going to release and I will discuss the role of bots in content networks that reward authors. Stay tuned!

Pre-release of the front-running software

You can front-run the front-runners and support my work at the same time. There is a script that automatically votes on articles, it paid for a few of my sushi dinners, but YMMV. It is written in nodejs and requires some knowledge of nodejs. Tested on Linux and macOS. I do not and cannot support the code, it works for me. Feel free to play, but note that you are supporting me and getting access to pre-release of unsupported software, not a support contract. You can get access on yours.org.

Before you go

If you like my writing, please note that I am currently working on a book called Financial Surveillance and Crypto Utopias, where I explain what happened to banking secrecy, how the current payment networks are regulated and how crypto can solve these problems, thus creating the unique value proposition for cryptocurrencies. Other peoples’ mistakes are the best value proposition for competing projects and this is the case for old-school financial sector vs cryptocurrencies. Read more about the project and sign up for updates and releases here.