Skip to content

Commit

Permalink
NUT-07: explicitly mention order (#181)
Browse files Browse the repository at this point in the history
* mention order

* refer to NUT-07 in P2PK and HTLCs

* prettier

* fix

* Ys
  • Loading branch information
callebtc authored Oct 29, 2024
1 parent ea8d7d6 commit d69242f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions 07.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`optional`

`used in: NUT-17`
`used in: NUT-17, NUT-11, NUT-14`

---

Expand Down Expand Up @@ -50,7 +50,7 @@ Where the elements of the array in `Ys` are the hexadecimal representation of th

**Response** of `Bob`:

`Bob` will respond with a `PostCheckStateResponse`
`Bob` responds with a `PostCheckStateResponse`:

```json
{
Expand All @@ -65,9 +65,11 @@ Where the elements of the array in `Ys` are the hexadecimal representation of th
}
```

The elements of the `states` array MUST be returned in the same order as the corresponding `Ys` checked in the request.

- `Y` corresponds to the `Proof` checked in the request.
- `state` is an enum string field with possible values `"UNSPENT"`, `"PENDING"`, `"SPENT"`
- `witness` is the serialized witness data that was used to spend the `Proof` if the token required it such as in the case of P2PK (see [NUT-11][11]).
- `witness` is the serialized witness data that was used to spend the `Proof` if the token has a [NUT-10][10] spending condition that requires a witness such as in the case of P2PK ([NUT-11][11]) or HTLCs ([NUT-14][14]).

With curl:

Expand Down Expand Up @@ -110,3 +112,4 @@ Where `Y` belongs to the provided `Proof` to check in the request, `state` indic
[10]: 10.md
[11]: 11.md
[12]: 12.md
[14]: 14.md
1 change: 1 addition & 0 deletions 10.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ kind <str>,
Example use cases of this secret format are

- [NUT-11][11]: Pay-to-Public-Key (P2PK)
- [NUT-14][14]: Hashed Timelock Contracts (HTLCs)

[00]: 00.md
[01]: 01.md
Expand Down
2 changes: 1 addition & 1 deletion 11.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The `B_` of each output is **signed as bytes** which comes from the original hex
}
```

The `signatures` are an array of signatures in hex.
The `signatures` are an array of signatures in hex. The witness for a spent proof can be obtained with a `Proof` state check (see [NUT-07][07]).

### Multisig

Expand Down
2 changes: 2 additions & 0 deletions 14.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ See [NUT-11][11] for a description of the signature scheme, the additional use o
}
```

The witness for a spent proof can be obtained with a `Proof` state check (see [NUT-07][07]).

[00]: 00.md
[01]: 01.md
[02]: 02.md
Expand Down

0 comments on commit d69242f

Please sign in to comment.