Skip to content

Latest commit

 

History

History
287 lines (206 loc) · 5.29 KB

File metadata and controls

287 lines (206 loc) · 5.29 KB
CHIP Number 0027
Title Signer Protocol Wallet APIs
Description The maximum set of APIs for the wallet signer protocol
Author Matt Hauff
Editor Dan Perry
Comments-URI CHIPs repo, PR #102
Status Final
Category Process
Sub-Category Tooling
Created 2024-03-14
Requires None
Replaces None
Superseded-By None

Abstract

This CHIP provides the maximum set of APIs that can be used with the wallet signer protocol.

Motivation

In order to use the wallet signer protocol, a standard set of APIs is needed. These APIs will be presented in human-readable JSON. Any wallet that wishes to implement the wallet signer protocol will need to serialize the APIs from this CHIP, for example by using the standard from CHIP-0029.

Backwards Compatibility

This CHIP does not introduce any backwards incompatibilities. The APIs from this CHIP were created for the new wallet signer protocol. They do not modify any existing APIs. In addition, no code forks are necessary for this CHIP's implementation.

Rationale

The specific APIs from this CHIP were created to be as simple as possible, while enabling the required functionality for communication with the wallet signer protocol.

Specification

The specification for this CHIP consists of two parts:

  1. The types used in the APIs
  2. The APIs themselves

Types

For brevity in the API descriptions, we will first define the following types:

coin

{
  "parent_coin_id": "..."
  "puzzle_hash": "..."
  "amount": "..."
}

spend

{
  "coin": <coin>
  "puzzle": "..."
  "solution": "..."
}

transaction_info

{
  "spends": [<spend>]
}

signing_target

{
  "pubkey": "..."
  "message": "..."
  "hook": "..."
}

sum_hint

{
  "fingerprints": ["..."]
  "synthetic_offset": "..."
  "final_pubkey": "..."
}
  • Note 1: synthetic_offset is an optional parameter
  • Note 2: final_pubkey indicates the resulting pubkey of the sum of the others

path_hint

{
  "root_fingerprint": "..."
  "path": ["..."]
}

key_hints

{
  "sum_hints": [<sum_hint>]
  "path_hints": [<path_hint>]
}

signing_instructions

{
  "key_hints": <key_hints>
  "targets": [<signing_target>]
}

unsigned_transaction

{
  "transaction_info": <transaction_info>
  "signing_instructions": <signing_instructions>
}

signing_response

{
  "signature": <signature>
  "hook": "..."
}

signature

{
  "signature_type": <signature_type>
  "signature": <signature>
}

Where valid options for <signature_type> include:

  • bls_12381_aug_scheme

signed_transaction

{
  "transaction_info": <transaction_info>
  "signatures": [<signature>]
}

APIs

This section contains a list of optional RPC APIs to be used with the wallet signer protocol.

Note on serialization

Each specific implementation will have the option for how to handle the serialization of the keys in this section.

For example, the return values for wallet RPC APIs typically are in JSON format, so the client code may send something like:

response["unsigned_transactions"]

This will send a list of BLOBs that are serialized according to the specified translation/serialization CHIPS, but the whole response will not be serialized in this way.


create_transactions

Note: In current practice this will come from many RPCs, though this may not necessarily always be true.

ARGUMENTS

Defined on a case-by-case basis.

RETURNS

{
  "unsigned_transactions": [<unsigned_transaction>]
}

gather_signing_info

ARGUMENTS

{
  "spends": [<spend>]
}

RETURNS

{
  "signing_instructions": <signing_instructions>
}

apply_signatures

ARGUMENTS

{
  "spends": [<spend>]
  "signing_responses": [<signing_response>]
}

RETURNS

{
  "signed_transactions": [<signed_transaction>]
}

submit_transactions

ARGUMENTS

{
  "signed_transactions": [<signed_transaction>]
}

RETURNS

{
  "mempool_ids": ["..."],
}

Reference Implementation

The APIs for this CHIP have been implemented in the following locations:

Security

Chia Network, Inc. has conducted an internal review of the code involved with this CHIP.

Additional Assets

None

Copyright

Copyright and related rights waived via CC0.