Skip to content

Instantly share code, notes, and snippets.

View melvincarvalho's full-sized avatar
💭
I may be slow to respond.

Melvin Carvalho melvincarvalho

💭
I may be slow to respond.
View GitHub Profile
@melvincarvalho
melvincarvalho / nip135.md
Last active January 19, 2024 01:30
nip135.md

NIP-135

DNSTR - Domain Name Mapping for Nostr Public Keys

draft optional author:melvincarvalho

This NIP defines a way to associate a Nostr public key with a domain name.

@melvincarvalho
melvincarvalho / NIP-133.md
Last active March 26, 2024 16:42
NIP-133.md

NIP-133

Nostr Game Score Event

draft optional author:melvincarvalho

This NIP defines an event used to represent scores for players within various games on the Nostr network. Each game is uniquely identified by a d tag, and each Nostr user can have a score associated with that game.

W3C Charter for Social Web Working Group: ActivityPub 2.0 and Activity Streams 3

  1. Introduction
    • Background and motivation for the Social Web Working Group
    • The role of ActivityPub 2.0 and Activity Streams 3 in the evolution of the social web
  2. Scope and Objectives
    • Define the scope of the Social Web Working Group
    • List the objectives and goals of the working group
  3. Key Deliverables
  • ActivityPub 2.0 Specification
import json
import argparse
from typing import List, Dict, Optional
from fastapi import FastAPI, WebSocket
from pydantic import BaseModel
from nostr import tools
import ssl
import uvicorn
parser = argparse.ArgumentParser()
@melvincarvalho
melvincarvalho / phone.js
Last active September 5, 2024 14:54
phone.js
#!/usr/bin/env node
import fastify from 'fastify'
import fastifyWebsocket from '@fastify/websocket'
import { validateEvent, verifySignature } from 'nostr-tools'
const port = process.argv[2] || 3000
const events = []
const subscribers = new Map()
@melvincarvalho
melvincarvalho / nostr-tx-broadcast.js
Created April 27, 2023 08:16
nostr-tx-broadcast.js
const WebSocket = require('ws');
const bitcoin = require('bitcoinjs-lib');
const fetch = require('node-fetch');
const base64 = require('base64-js');
const relays = [
'wss://nostr.wine',
'wss://nos.lol',
'wss://nostr.fmt.wiz.biz',
'wss://nostr.zebedee.cloud',
<form action="upload.php" method="post" enctype="multipart/form-data">
<div style="text-align:center;">
<label for="fileToUpload" style="font-size: 18px; font-weight: bold;">Select an Image:</label><br>
<input type="file" name="fileToUpload" id="fileToUpload" style="color: #C0C0C0;"><br>
<label for="img_url" style="font-size: 18px; font-weight: bold;">OR paste image URL to import:</label><br>
<input type="text" name="img_url" id="img_url" placeholder="https://example.com/image.jpg" style="width: 250px;"><br>
<input type="submit" value="Upload" name="submit" class="sbtn btn btn-secondary btn-c" onclick="spinner()">
</div>
<div class="loader">
<div class="loading"></div>

NIP-17

Git Commits and Discovery Over Nostr

draft optional author:melvincarvalho

  • Reserves: kind 17
@melvincarvalho
melvincarvalho / czech answers
Last active September 13, 2022 12:29
czech answers
Mezinárodní den žen.
Advent.
Na Velikonoce.
Den boje za svobodu a demokracii.
K Velikonocům.
Na podzim.
V září.
24. prosince.
Ježíšek.
Tři králové.
file: bad-stamp.txt.ots
File sha256 hash: 7e3717bbe020f53cdc6c40154a1a8e55bddc13a28c8bb3c82e9ee64b81b44872
Timestamp:
ripemd160
prepend 0100000001e482f9d32ecc3ba657b69d898010857b54457a90497982ff56f97c4ec58e6f98010000006b483045022
100b253add1d1cf90844338a475a04ff13fc9e7bd242b07762dea07f5608b2de367022000b268ca9c3342b3769cdd06289131
7cdcef87aac310b6855e9d93898ebbe8ec0121020d8e4d107d2b339b0050efdd4b4a09245aa056048f125396374ea6a2ab070
9c6ffffffff026533e605000000001976a9140bf057d40fbba6744862515f5b55a2310de5772f88aca0860100000000001976
a914
append 88ac00000000