howestsecandpriv/iotasigneddata
最新稳定版本:0.2
Composer 安装命令:
composer require howestsecandpriv/iotasigneddata
包简介
Interface for Howest Security & Privacy's Iota signed data API
README 文档
README
The IotaSignedData package is a package for Laravel that allows for the writing of a hash to the IOTA blockchain. The package makes use of the Guzzle HTTP client to interact with the IOTA SignedData API. The package utilizes the env() function to fetch the IOTA SignedData API's URL and JWT token from the environment variables.
Requirements
- Laravel 7+
- PHP 7.2+
- Guzzle HTTP client
- IOTA SignedData API that implements an interface defined by the Web3 Team, Security and Privacy Research Group, Howest
Installation
To install the package, first install it using composer by running the command:
composer require howestsecandpriv/iotasigneddata
Configuration
The package requires two environment variables to be set in your .env file:
IOTA_SIGNED_DATA_API_URL: the URL of the IOTA SignedData API, should have a trailing slash.IOTA_NODE_JWT_TOKEN: the JWT token to authenticate with the API. The JWT token contains the freelancer_id, which is used by the API as the payload index in IOTA
Usage
The package provides a single public method writeHash(string $hash, string $preImage = null): string that takes in a hash and an optional pre-image.
$response = IotaSignedData::writeHash("7bf4ab29630fc6dfa187f8a6b68a1efa8e36e8f2a8904ec7b3460ebfae1d2cd2", "pre-image");
The method first checks if the pre-image is provided and if it matches the hash. If the pre-image is provided but does not match the hash, an exception is thrown.
The method then uses the Guzzle HTTP client to send a POST request to the IOTA SignedData API with the provided hash and the JWT token in the headers. If the request is successful, the response body is returned. If the request is unsuccessful, an exception is thrown.
The IOTA SignedData API makes a signature pre-image that consists of concatenation of the freelancer_id and the hash. Then the API signs it. This way, it can be guaranteed that only the freelancer could have posted this to the API (explains need for freelancer_id concatenation), and that only the API could have written it to the tangle (that's the signature part).
Author
Shane Deconinck (shane.deconinck@howest.be)
© Web3 Team, Security and Privacy Research Group, Howest
howestsecandpriv/iotasigneddata 适用场景与选型建议
howestsecandpriv/iotasigneddata 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 howestsecandpriv/iotasigneddata 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 howestsecandpriv/iotasigneddata 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-15