=============== LIBRARY RULES =============== From library maintainers: - CANARY extends spoken-token with duress detection — a wrong token signals coercion without alerting the coercer. - Verification is bilateral — both parties prove liveness, not just the subject. - Group verification supports M-of-N threshold checks. ### Explain Account Path Choices Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Provides an explanation for choosing between different account derivation paths, specifically mentioning `nsec` roots and mnemonic-backed roots for `nsec-tree` hierarchy. Useful for guiding users on account setup. ```html

Which path should I choose?

Both imported nsec roots and mnemonic-backed roots can derive the full nsec-tree hierarchy. ``` -------------------------------- ### Install canary-kit Source: https://github.com/forgesworn/canary-kit/blob/main/llms.txt Command to install the library via npm. ```bash npm install canary-kit ``` -------------------------------- ### Run Beacon Encryption Example Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Execute the encrypted location beacons example script. Requires Node.js 22+. ```bash node examples/04-beacon-encryption.ts ``` -------------------------------- ### Run Phone Verification Example Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Execute the phone verification example script. Requires Node.js 22+ and tsx/ts-node. ```bash node examples/01-phone-verification.ts ``` ```bash npx tsx examples/01-phone-verification.ts ``` -------------------------------- ### Initialize Project Environment Source: https://github.com/forgesworn/canary-kit/blob/main/CONTRIBUTING.md Commands to clone the repository and install necessary dependencies. ```bash git clone https://github.com/forgesworn/canary-kit.git cd canary-kit npm install ``` -------------------------------- ### Run Duress Detection Example Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Execute the duress detection example script for silent alerting. Requires Node.js 22+. ```bash node examples/03-duress-detection.ts ``` -------------------------------- ### Build Canary Kit Library Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Compile the library before running examples. Assumes Node.js 22+. ```bash npm run build ``` -------------------------------- ### Run Family Group Example Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Execute the family group example script, demonstrating safe words and duress detection. Requires Node.js 22+. ```bash node examples/02-family-group.ts ``` -------------------------------- ### Run Nostr Events Example Source: https://github.com/forgesworn/canary-kit/blob/main/examples/README.md Execute the example script for building Nostr events for the CANARY protocol. Requires Node.js 22+. ```bash node examples/05-nostr-events.ts ``` -------------------------------- ### Initialize Constants Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Initializes constants and performs necessary setup for the library. This should be called once before using other functions. ```javascript var dA,fA,pA=o((()=>{ am(), A(), vm(), Ah(), nl(), LT(), dA=25519, fA=35520 })) ``` -------------------------------- ### Initialize Canary Kit Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Initializes the Canary Kit by calling various setup functions and initializing global state variables. ```javascript var FE,IE,LE,RE,zE,BE,VE=o(((()=>{am(),A(),vm(),Bp(),Qg(),y(),Ru(),FE=new Map,IE=new Map,LE=6e4,RE=new Set,zE=[`wss://purplepag.es`,`wss://relay.damus.io`,`wss://nos.lol`],BE=zE})); ``` -------------------------------- ### Developer Derivation Example Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html This example demonstrates how to derive child identities. It requires a local key; browser extensions cannot be used here as they keep the secret key hidden. ```html

Developer derivation example

Enter up to three tree levels plus explicit indices and canary-kit recreates the deterministic child identity, including its npub and nsec.

${s&&s.length<=3?: `}
${ [0,1,2].map(e=>`
Level ${e+1}
`).join( ` `)}
${s? `Selected path: ${Y(s.map(e=>`${e.name}@${e.index??0}`).join(` / `))}${s.length>3? ` — this example only exposes the first three tree levels, so fill it manually if you need a deeper path.`: `}`: `Tip: select a persona in the tree, then load it here to show that the same derivation inputs recreate the same identity. Change indices to match rotated personas.`}
${zM()}
``` ```html

Developer derivation example

This needs a local key. Browser extensions keep the raw secret hidden, so canary-kit cannot recreate child identities here.

``` -------------------------------- ### Initialize Canary Kit Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Initializes the entire Canary Kit, including personas, hashing, and other utilities. This is a one-time setup call. ```javascript var U,Lu,Ru=o((()=>{nu(),hu(),ts(),yu(),A(),U=null,Lu=new Map})) ``` -------------------------------- ### Initialize Canary Kit Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Initializes canary-kit by calling setup functions for various components. Sets up regular expressions and constants for group management. ```javascript var Nl,Pl,Fl=o(((()=>{nl(),pl(),Cl(),Tl(),Nl=/^\x5B0-9a-f\x5D{64}$/,Pl=100}))) ``` -------------------------------- ### Initialize Login Screen UI Source: https://github.com/forgesworn/canary-kit/blob/main/canary.html Sets up the main application container and renders the login screen UI, including options for connecting with Nostr or a quick start. ```javascript function yF(){let e=document.getElementById(`app`);e.innerHTML=`

CANARY

Deepfake-proof identity verification