-
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 ef91f61
Showing
6 changed files
with
24 additions
and
60 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 allows for 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: | ||
1. delivering blog posts that are markdown-based | ||
2. unlocking paywalled content | ||
3. delivering invoices | ||
4. subscribing to messages | ||
5. asking payment authentication/authorization to the API server for all of the above | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
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. | ||
|
||
```bash | ||
npm run dev | ||
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). | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
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. | ||
|
||
## Building | ||
Nostr protocol is a decentralized network similar to Bitcoin, which is used in this blog to share proof of payments safety and securely without the need for any counterparty. | ||
|
||
To create a production version of your app: | ||
## L402 protocol flow | ||
|
||
```bash | ||
npm run build | ||
``` | ||
![](doc/challenge-response.sequence.png) | ||
|
||
You can preview the production build with `npm run preview`. | ||
TODO | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. |
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