Paywall a specific link within website that can only be unlocked IF a specific transaction on Ethereum exists between reader and owner.
For e.g., you want to give away first 2 chapters of your book, but want to paywall other chapters of your book.
📦 book.com
┣ 📜 /chapter1
┣ 📜 /chapter2
┣ 🦊 /chapter3
┣ 🦊 /chapter4
┣ 🦊 /chapter5
┗ 🦊 /chapter6
If you want to paywall a link:
-
Go to https://0xwall.app/login
-
Login with metamask
-
Go to links
-
Add tier
-
Add links in the tier, pricing and other details. Make sure that the domain is the same as link for e.g.,
Links: book.com/chapter1 book.com/chapter2
Domain will be: book.com
-
Go to your website source code.
-
Paste this in the
<head>
tag:
<script src="https://0xwall.app/api/extension" defer></script>
-
Go to the editor of your Carrd website and add an "Embed" component.
-
Change the type to "Code" and give it any name that you want.
-
Paste the above script
That should be it.
Video:
e_oseku made a detailed walk through to integrate with your Carrd website.
-
Go to dashboard.
-
To sites.
-
Select your website.
-
Paste the script in custom code.
Video:
MT Jack made a walk-through you can follow that.
PS: He did it while sipping coffee
-
Go to
_document.js
-
Paste script, you'll have to add
async
attribute. Source
-
In the "Menu", click "Settings", and then "Code Injection".
-
Add script to the "Site Header" text box. Code added into the "Site Header" field is injected into the tag on every page of your site.
-
After adding the script, click on the "Save" button.
If you run into a website that is paywalled by 0xwall:
If you see the pay button, author will allow access to the link only when there is a transaction done
-
Press the pay button
-
Metmask opens up asking you to authorize the transaction
-
🔴 Read the transaction details carefully. Don't press confirm if you are not sure, discuss with the author if you have any concerns.
-
Authorize the transaction if you feel it is safe.
Bonus feature that no one asked, but I felt it would be great to have is token based paywalling.
The mechanics are mostly same:
-
For writers, they have to choose type:
token
in transactions,contract address
and minimumtoken balance
(can't be 0). -
For readers, the links will automatically unlock if the
token
is in your wallet. You don't have to press any pay button.
One thing for writers while using tokens is, you won't see any transactions in the Reader section.
- Do I need to do KYC or present any legal document to get started?
None. Just need a metamask wallet to authenticate.
- Is this service free?
First 10 links are free, then it is 0.007 ETH/link (price may change).
- Will you give few free link if I am a friend?
Yes 😉
- What does the database architecture look like? Are you storing personal data?
None.
This is the database architecture I am using. (Pasted from original notes)
paywall_writer_links
writer_account | link | tier_id |
---|---|---|
e_oseku_addr | hacktags.carrd.co/1 | 1 |
e_oseku_addr | hacktags.carrd.co/2 | 2 |
paywall_link_tiers
writer_account | id | name | domain | type | price | contract_addr | token_balance |
---|---|---|---|---|---|---|---|
e_oseku | 1 | chapter 1 | hacktags.carrd.co | tx | 0.02 | (for nft type,later) | |
e_oseku | 2 | chapter 2 | hacktags.carrd.co | tx | 0.1 | (for nft type,later) |
paywall_reader_tx
reader_account | tier_id | tx | created_at |
---|---|---|---|
nishant_addr | 1 | 0x..9 |
paywall_my_payments
writer_account | service_tier | tx |
---|---|---|
e_oseku_addr | 20 | - |