draft
optional
author:wakoinc
This NIP is an extension to NIP-98 which allows HTTP authorization using a base64 encoded event header. This NIP documents a typical protocol flow for failure, retry and success - or hard fail.
FROM alpine:3.6 | |
RUN apk add --no-cache rust cargo | |
COPY project /build | |
WORKDIR /build | |
RUN ["cargo", "build", "--release"] | |
ENTRYPOINT ["cargo", "run", "--release"] |
draft
optional
author:wakoinc
This NIP is an extension to NIP-98 which allows HTTP authorization using a base64 encoded event header. This NIP documents a typical protocol flow for failure, retry and success - or hard fail.
require 'sinatra' | |
get '/public/AUTHIMAGE.jpg' do | |
auth_header = request.env['HTTP_AUTHORIZATION'] | |
puts auth_header | |
# Check if the header value starts with "Nostr " | |
unless auth_header && auth_header.start_with?("Nostr ") | |
headers['WWW-AUTHENTICATE'] = 'NOSTR-NIP-98' | |
headers['Access-Control-Expose-Headers'] = 'WWW-Authenticate' |
Nostr 'My Services' Event Kind (Draft/Experiment)
A way to support in-app management of services with subscriptions and credits where a payment is due (I guess it can be free too?).
A client app can query for these events and show a list of services that are active or have credit remaining. They can show a list of expired (or no credit left) services as well. Clicking a service can allow you to make a payment based on the payment options provided.
What to support
Pain Points / design limitations
Missing Features
#[macro_use] | |
extern crate log; | |
use anyhow::Result; | |
use bech32::FromBase32; | |
use secp256k1::hashes::hex::ToHex; | |
use std::convert::TryFrom; | |
fn parse_tlv(data: &[u8]) -> Vec<(u8, &[u8])> { | |
let mut result = vec![]; |
require 'sinatra' | |
require 'json' | |
# class App < Sinatra::Application | |
configure do | |
enable :sessions | |
end | |
get '/' do |
// https://github.com/nostr-protocol/nips/blob/master/57.md | |
// | |
// Quick and dirty Rust Nostr ZAP Validation | |
// | |
// anyhow = "1.0.68" | |
// bech32 = "0.9" | |
// lightning-invoice = "0.21.0" | |
// nostr-rs-relay = "0.7.2" | |
// serde_json = "~1" |