-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70e6e42
commit f773569
Showing
7 changed files
with
25 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
# create-svelte | ||
# Self-Sovereign Blog | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
The self-sovereign blog is a showcase of "paywall without intermediaries". | ||
|
||
## Creating a project | ||
This blog is handcrafted by SvelteKit and can be hosted anywhere. Payments for paywall use Bitcoin which is the border-less internet native money, specifically Lightning Network which is the layer2 of Bitcoin and realizes fast finality and micro payments. The proof of payment is shared between buyers and sellers through messaging using the Nostr protocol. | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
Both Bitcoin and Nostar are the people's networks without specific authorities. So, this paywall is Self-Sovereignty, with no middlemen involved. | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
## Overview | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
![](doc/overview.png) | ||
|
||
## Developing | ||
The front server is responsible for: | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
1. delivering blog posts that are markdown-based | ||
2. unlocking paywalled content | ||
3. delivering invoices of paywall | ||
4. setting up to subscribe to messages for the payment proof | ||
5. asking payment authentication/authorization related to all of the above to the API server | ||
|
||
```bash | ||
npm run dev | ||
Payment authentication/authorization for paywall follows the [Lightning HTTP 402 Protocol (L402 protocol)](https://github.com/lightning/blips/pull/26) that repurposes the `HTTP 402 Payment Required` error code and is a standardized way of adding micropayments to any existing HTTP-REST or gRPC API. | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
The API server coodinates two networks that are Lightning Network for payments and Nostr protocol for messagings, and executes L402 protocol. You can check the [sample implementation](https://github.com/studioTeaTwo/simple-l402-server) for this blog which wraps the L402 API Key proxy called [Aperture](https://github.com/lightninglabs/aperture). | ||
|
||
## Building | ||
Lightning Network is Bitcoin's layer2 used for payment network. Bitcoin is decentralized internet money, so users can pay from any wallet that supports Lightning Network. | ||
|
||
To create a production version of your app: | ||
Nostr protocol is a decentralized network similar to Bitcoin, which is used in this blog to share the proof of payments safety and securely without the need for any counterparty. | ||
|
||
```bash | ||
npm run build | ||
``` | ||
## L402 protocol flow | ||
|
||
You can preview the production build with `npm run preview`. | ||
![](doc/challenge-response.sequence.png) | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||
TODO |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters