Skip to content

Instantly share code, notes, and snippets.

View bnonni's full-sized avatar

bryan bnonni

View GitHub Profile
import { base64url } from '@scure/base';
import { entropyToMnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';
// Function to convert Base64URL string to Uint8Array
function base64UrlToUint8Array(b64url: string): Uint8Array {
return base64url.decode(b64url + '='.repeat((4 - (b64url.length % 4)) % 4));
}
// Function to convert the private key to a BIP39 mnemonic
import { Web5 } from '@web5/api';
import { DidJwk, DidDht, BearerDid } from '@web5/dids';
import { DwnRegistrar } from '@web5/agent';
import { Web5UserAgent } from '@web5/user-agent';
let initialize;
const instances = {};
const storage = {
get: (key, _default) => {
@bnonni
bnonni / dwa-ideas.md
Last active September 17, 2024 21:51
  • chat5 - application for unifying your chats
    • Allows users to store messages from different chat platforms in dwn protocol
    • Authenticates with did and accesses local /chat protocol to access all platforms available
    • Can encrypt messages at any level of the tree, etc.
    • Platforms get listed under the /chat protocol path like so
    • Telegram: /chat/telegram/{...}
    • Discord: /chat/discord/{...}
    • Slack: /chat/slack/{...}
    • Signal: /chat/signal/{...}
  • 5ocial - same idea as chat but for social media; unifying your social media profiles
  1. In a clean folder, copy connect.ts and recover.ts
  2. Set a password in connect.ts
  3. Run tsx connect.ts and let it run. It'll hang at the sync, let it sit for a 10 sec or so then kill it.
  4. Copy the recovery phrase that prints out, and make note of the did identities it created.
  5. Delete the DATA folder, paste the recovery phrase into recover.ts and run tsx recover.ts

Note You'll need to checkout this branch on our repo and build locally: https://github.com/FormFree/web5-js/tree/api/web5-recover Then you'll need to start a new npm project and run npm install /path/to/FormFree/web5-js/clone/api/web5-recover/branch

@bnonni
bnonni / did-devs-1.md
Last active July 15, 2024 22:26
DIDdevs: Decentralized Web Meetup #1

Atlanta Bitdevs Reading Group

Topic: Learnings from a Chaincode Seminar

What is Atlanta BitDevs / Atlanta BitDevs Reading Group?

Atlanta BitDevs is a place for free and open Bitcoin education in Atlanta. Discussions will be technical but are open to people of all skill levels. 📙 Atlanta BitDevs' reading groups are small sessions where we focus on a specific topic within Bitcoin development and help each other understand it through discussion.

Bitcoin Socratic Seminar #18

https://atlantabitdevs.org/2023/05/30/bitcoin-socratic-seminar-18/ https://www.meetup.com/atlantabitdevs/events/293790513/

Topics

Bitcoin Core v25.0 Release

  1. P2P and network changes
    • Txns with min size of 65 bytes of non-witness data are now allowed by mempool and relay policy
    • Continues to mitigate CVE-2017-12842 64 byte vulnerability while opening up additional smaller transaction size use-cases
  • CVE-2017-18350 is a buffer overflow vulnerability which allows a malicious SOCKS proxy server to overwrite the program stack on systems with a signed char type (including common 32-bit and 64-bit x86 PCs).

Bitcoin Socratic Seminar #16

OP_VAULT

  • OP_VAULT makes use of a highly secure key as an unlikely recovery path in the event of an unplanned unvaulting attempt by a bad actor

Example

  • Alice spends UTXOs into vault
  • Alice is running software to monitor the blockchain for spends of the vault outpoints
  • An unvaulting attempt is triggered: either by Alice or by Bob