# chia-signing-tools

> ## Proposed Signing Protocol

Latest version **0.2.2** (published 2023-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install chia-signing-tools
pnpm add chia-signing-tools
yarn add chia-signing-tools
bun add chia-signing-tools
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2023-03-05 |
| First published | 2023-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 76.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | mikehw |

## Links

- npm: https://www.npmjs.com/package/chia-signing-tools
- Repository: https://github.com/mikehw/chia-signing-tools
- Homepage: https://github.com/mikehw/chia-signing-tools#readme
- Issues: https://github.com/mikehw/chia-signing-tools/issues
- npm.io page: https://npm.io/package/chia-signing-tools

## Dependencies (6)

- [zod](https://npm.io/package/zod.md) ^3.20.2
- [bech32](https://npm.io/package/bech32.md) ^2.0.0
- [clvm-lib](https://npm.io/package/clvm-lib.md) ^1.0.0
- [chia-agent](https://npm.io/package/chia-agent.md) 10
- [node-fetch](https://npm.io/package/node-fetch.md) 2
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) 2

## Recent versions

- 0.2.2 (latest) — 2023-03-05
- 0.2.1 — 2023-03-05
- 0.2.0 — 2023-02-05
- 0.1.2 — 2023-02-05
- 0.1.1 — 2023-02-05
- 0.1.0 — 2023-02-05

## README

# Chia DID Signing Tools

## Proposed Signing Protocol

As a first step to establishing a decentralized DID reputation
and trust graph system, this package demonstrates a protocol
for signing and verifying messages from Chia DIDs using the Chia Wallet RPC.

DID-Signed messages are JSON strings in the format

```JSON
{
  "did": "DID",
  "msg": "body",
  "sig": "signature"
}
```

`sig` is generated by DID's Wallet signing the `msg` string.


NFT-Signed messages are JSON strings in the format

```JSON
{
  "nft": "nft1...",
  "col": "col1...",
  "msg": "body",
  "sig": "signature",
  "pubkey": "public key used to sign"
}
```

`sig` is generated by NFT signing the `msg` string.

## Using the tools

For version 0.2.x you must be running the chia wallet to sign and verify the message.

[chia-agent](https://github.com/Chia-Mine/chia-agent) is used to interact with the chia daemon and wallet.

```ts
import { sign_message, verify } from 'chia-signing-tools';
// Log in with appropriate key and select DID wallet to sign with
const message = await sign_message(did, 'message to sign');
// Verify the signature of a message
const verified = await verify(JSON.stringify(message));
```

```

## Version Compatibility
Version 0.1.x used the property "message" instead of "msg" in the JSON message format, and signed both the did and the message.  Version 0.2.x uses the property "msg" and only signs the message. The verify command will accept either format.
```

---
_Source: https://npm.io/package/chia-signing-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
