Nostr CN
  • 什么是NOSTR
    • Nostr 简介
    • Nostr可以做什么
  • 如何快速加入NOSTR
    • 如果你是程序员
    • 如果你不是程序员
  • 附录1 NIP详解
    • NIP01
    • NIP02
    • NIP03
    • NIP04
    • NIP05
    • NIP06
    • NIP07
    • NIP08
    • NIP09
    • NIP10
    • NIP11
    • NIP12
    • NIP13
    • NIP14
    • NIP15
    • NIP16
    • NIP17
    • NIP18
    • NIP19
    • NIP20
    • NIP21
    • NIP22
    • NIP23
    • NIP25
    • NIP26
    • NIP28
    • NIP33
    • NIP36
    • NIP39
    • NIP40
    • NIP42
    • NIP46
    • NIP50
    • NIP51
    • NIP56
    • NIP57
    • NIP58
    • NIP65
    • NIP78
  • 附录2 中继器实现
  • 附录3 客户端实现
Powered by GitBook
On this page
  • Web 浏览器的 window.nostr 功能
  • 实施
  1. 附录1 NIP详解

NIP07

原文:https://github.com/nostr-protocol/nips/blob/master/07.md

PreviousNIP06NextNIP08

Last updated 2 years ago

Web 浏览器的 window.nostr 功能

draft optional author:fiatjaf

该 window.nostr 对象可以通过网络浏览器或扩展变得可用,并且网站或网络应用程序可以在检查其可用性之后使用它。

该对象必须定义以下方法:

async window.nostr.getPublicKey(): string // returns a public key as hex
async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it

除了上述两个基本功能外,还可以选择实现以下功能:

async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04

实施

  • (Chrome 及其衍生产品)

  • (Chrome 及其衍生产品、Firefox、Safari)

  • (Chrome 及其衍生产品)

  • (Firefox)

  • (Chrome 及其衍生产品)

nos2x
Alby
Blockcore
nos2x-fox
Flamingo