Stacks + Nostr
  • Introduction: Stacks + Nostr
  • SIP and NIP Summaries
    • SIP Summaries
      • SIP-000: The Stacks Improvement Proposal Process
      • SIP-001: Burn Election
      • SIP-002: The Clarity Smart Contract Language
      • SIP-003: Stacks P2P Network
      • SIP-004: Cryptographic Commitment to Materialized Views
      • SIP-005: Blocks, Transactions, and Accounts 👀
      • SIP-006: Clarity Cost Execution Assessment
      • SIP-007: Stacking Consensus
      • SIP-008: Clarity Parsing and Analysis Cost Assessment
      • SIP-009: Standard Trait Definition for Non-Fungible Tokens
      • SIP-010: Standard Trait Definition for Fungible Tokens
      • SIP-012: Burn Height Selection for a Network Upgrade to Introduce New Cost-Limits
      • SIP-013: Standard Trait Definition for Semi-Fungible Tokens
      • SIP-015: Stacks Upgrade of Proof-of-Transfer and Clarity
      • SIP-016: Metadata for Tokens
      • SIP-018: Signed Structured Data
      • SIP-020: Bitwise Operations in Clarity
    • NIP Summaries
      • NIP-1
      • NIP-2
      • NIP-3
      • NIP-4 👀
      • NIP-5 👀
      • NIP-6 👀
      • NIP-7
      • NIP-8
      • NIP-9
      • NIP-10
      • NIP-11
  • Feature Unlocks
    • Decentralized Identity Verification
    • Censorship-Resistant Social Networking
    • Secure Asset Management
    • Private Voting and Governance
    • Decentralized Notifications
    • Trustless Collaboration
  • Related Tech 👀
    • BNS
    • sBTC
  • Experimental Design and Methodology
  • Results and Discussion
  • Conclusion
  • Additional Research
    • ZKP
    • Indistinguishability Obfuscation from Well-Founded Assumptions
  • SIP-xx Draft
  • Disclaimer:
Powered by GitBook
On this page
  1. SIP and NIP Summaries
  2. NIP Summaries

NIP-7

NIP-07 introduces the window.nostr object for web browsers or extensions, providing essential methods for working with public keys and events, as well as optional functions for relay management

NIP-07 proposes the window.nostr object for web browsers or extensions, which can be utilized by websites or web apps after checking their availability. The window.nostr object must define two essential methods:

  1. async window.nostr.getPublicKey(): string - returns a public key as a hex string.

  2. async window.nostr.signEvent(event: Event): Event - takes an event object, adds id, pubkey, and sig, then returns it.

Additionally, the following optional functions can be implemented:

  1. async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } - returns a basic map of relay URLs to relay policies.

  2. async window.nostr.nip04.encrypt(pubkey, plaintext): string - returns ciphertext and iv as specified in NIP-04.

  3. async window.nostr.nip04.decrypt(pubkey, ciphertext): string - takes ciphertext and iv as specified in NIP-04.

Several implementations of NIP-07 are available for different browsers and extensions, including Horse, nos2x, Alby, Blockcore, nos2x-fox, and Flamingo, compatible with Chrome and its derivatives, Firefox, and Safari.

PreviousNIP-6 👀NextNIP-8

Last updated 2 years ago