Anybody who has ever created a survey knows how hard it is to convince people to participate in it, even if it is just an RSVP for your friends. Psychology students are especially grateful for every classmate that agrees to fill out their endless questionnaires that feel like they are asking the same thing over and over again.

Services like Swagbucks and Survey Junkie promise to pay big bucks for your opinions on brands, doing market research for big companies (who probably already know too much about you). You earn tokens for participation and eventually you can redeem them for gift cards or Paypal credit. A go-to platform for researchers does not really exist. Well-known universities have their own platforms for paid surveys; however, the on-boarding process can be slow and they are sometimes limited to students only. Additionally, the surveys there are usually created by professors and not by masters students desperate for participants.

ILP-Surveys could be the tool to the rescue. Anybody can create a survey, fund it, and pay participants out of these funds. It is a proof-of-concept, using the Interledger Protocol (ILP) to send micropayments in real-time, so there’s no accumulating of points before getting paid.

Recommended Reading

ILP-Surveys is one specific use case for the Interledger Protocol. All the necessary concepts for this application will be explained; however, I am not going into too much detail. If you want to get a bigger picture, I recommend the following posts:

How does ILP-Surveys work?

ILP-Surveys itself is a Bootstrap + Koa + Redis application to create, participate in, and retrieve the answers of a survey. Since it is only a proof-of-concept, I did not put any effort into making it look appealing. When you visit the landing page, this is what you get.

For now, all amounts are displayed in XRP. The beauty of Interledger, however, is that it is ledger-agnostic. Thus, a survey creator could use Ether to fund her survey and a participant could decide to be paid in USD. As of today, Interledger plugins for XRP, Lightning Network, Ethereum, Paypal, and Venmo exist.

The little tag stating 2 XRP in the corner of the survey card indicates that each question answered pays out 2 XRP. As of today, that is worth $0.66. Since each survey comes with a mandatory set of 6 demographics questions, the minimum payout will be (6 + 1) * $0.66 = $4.62. This is probably a little expensive for the average Psychology student already highly in debt, but you can offer as little as 0.01 XRP (= $0.007) per answer. Interledger itself would even support micropayments of 1 nano-XRP, but this would probably not attract any participants.

When you click on Participate, you are asked to provide a participation code (which makes sure that one person cannot participate multiple times and skew the answer distribution) and your SPSP payment pointer. An SPSP payment pointer is comparable to an email address, but instead of receiving data, it is able to receive money. The easiest way to get a payment pointer if you don’t want to run your own SPSP server is via XRP Tip Bot. It creates a pointer based on your Twitter, reddit or Discord account and hosts it for you.

While you are answering the survey questions, the balance on the bottom left keeps increasing. While the application could send these micropayments right away, this would not incentivize people to finish the survey. Thus, this counter is only for the user to keep track of how much she has accumulated already. When she answers the last question, however, and hits Submit, the total amount is streamed to her payment pointer right away. No threshold of $10 has to be reached in order to receive a payout!

How does ILP-Surveys REALLY work?

So far, I’ve given you the fluffy, non-technical overview of the platform. Let’s get into the nitty-gritty details. The ILP-Surveys itself only serves as a storage and display application and there is nothing special about that. The interesting part is the SPSP server.

Prerequisites

ILP-Surveys depends on a Redis client running. The easiest way to set that up is by running it in a docker container.

In order to send and receive payments, you need to be running an instance of Moneyd that connects you to the network . You could either connect to the testnet using or you can run a local network to fiddle around with the stack.

# testnet

moneyd xrp:start --testnet # local network

moneyd local

The SPSP server

Whenever a survey is created, an SPSP payment pointer is created on the SPSP server. This payment pointer stores the monetary information about this survey, i.e., what has already been sent to this endpoint ( current ), how much it will accept in total ( maximum ), and how much is still available for payout ( available ), together with its ILP address and a secret used for package encryption to STREAM the money. This is the data that is stored for the example survey shown above:

http GET ilpsurvey.localtunnel.me/23a9c6ea-c5ee-4f68-83e4-ef1360c8f2f2 Accept:"application/spsp4+json" HTTP/1.1 200 OK

Connection: keep-alive

Content-Length: 386

Content-Type: application/spsp4+json

Date: Thu, 10 Jan 2019 22:44:59 GMT

Server: nginx/1.10.1 {

"destination_account": "private.moneyd.local.zQqGsK6bg6q4J1TL00XvAdyL8v93VurOWLpnMgSzNb8.63swBEGQNvnn52vMRvBq-uag~23a9c6ea-c5ee-4f68-83e4-ef1360c8f2f2",

"shared_secret": "dXGYytLMt8xCFh3a7tpfSbgmRuol4Y5ZHgVdrXGj67U="

"balance": {

"available": "0",

"current": "0",

"maximum": "28000000"

},

"receiver_info": {

"name": "My Sample Survey"

}

}

The creator needs to activate the survey by funding this endpoint. Every time Interledger packets are streamed to this endpoint, balance.current as well as balance.available are increased by this amount as long as balance.current does not exceed balance.maximum , which is the amount required to fully fund the survey. Furthermore, the endpoint sends the payment details via a webhook to the ILP-Surveys application. ILP-Surveys will automatically activate the survey for participation whenever the endpoint is fully funded, i.e., whenever balance.current equals balance.maximum . This is the easiest possible implementation, therefore I chose it for this proof-of-concept. One could design it differently where balance.maximum is the total amount the creator would ever want to spend over several iterations of the survey. The survey is activated whenever enough funds are available for one participant and deactivated whenever balance.available drops below the payout of one submission.