承接 nostriphant/nip-01 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nostriphant/nip-01

Composer 安装命令:

composer require nostriphant/nip-01

包简介

Nostr NIP-01 implementation in PHP

README 文档

README

Nostr NIP-01 implementation in PHP, currently this contains only the private/public key related code. This package requires the secp256k1-nostr-php extension to be installed. Follow their installation instructions first.

Key usage

use nostriphant\NIP01\Key;

$private_key = Key::fromHex('435790f13406085d153b10bd9e00a9f977e637f10ce37db5ccfc5d3440c12d6c');

$public_key = $private_key(Key::public());

$hash = hash('sha256', 'Hello World');
$signature = $private_key(Key::signer($hash));

if (Key::verify($public_key, $signature, $hash)) {
    echo 'Signature belongs to hash';
}

Message usage

use nostriphant\NIP01\Message;

$message = Message::count(1);
print $message; // prints "['COUNT',1]"

use nostriphant\NIP01\Message;
use nostriphant\NIP01\Event;

$rumor = new Rumor(
    pubkey: $sender_pubkey,
    created_at: time(),
    kind: 14,
    content: 'Hello!!',
    tags: [['p', $recipient_pubkey]]
);
$message = Message::event($rumor($private_key));
print $message; // prints "['EVENT',{...}]"

统计信息

  • 总下载量: 1.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固