You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix x402 guide verification section and wallet adapter imports
- Use listFeedbacks (has taskRef) instead of searchFeedback (doesn't)
- Add missing hexToBytes import in server-side wallet adapter code
- Both verified against actual SDK types and x402 API source
@@ -5,20 +5,159 @@ description: Link feedback directly to x402 payment transactions
5
5
6
6
# x402 Payment Feedback
7
7
8
-
::: warning Coming Soon
9
-
This guide is under active development. SATI is designed as the feedback extension for [x402](https://x402.org) payments (see [PR #1024](https://github.com/coinbase/x402/pull/1024)), but the end-to-end integration guide is not yet ready.
10
-
:::
8
+
SATI is designed as the feedback extension for [x402](https://x402.org) payments. The payment transaction signature becomes the `taskRef`, creating a cryptographic link between payment and feedback.
11
9
12
-
## What This Will Cover
10
+
## How It Works
13
11
14
-
- Linking feedback attestations to x402 payment transaction hashes
15
-
- The payment-as-taskRef model: the payment tx becomes the deterministic reference for feedback
16
-
- Who pays for on-chain submission (agent pays for positive, client pays for negative)
17
-
- Integrating SATI feedback into x402 seller and buyer flows
12
+
1. Client pays for a service via x402 (HTTP 402 flow)
13
+
2. Facilitator settles the payment on Solana, producing a transaction signature
14
+
3. After service delivery, the facilitator (or client) submits SATI feedback with the payment signature as `taskRef`
15
+
4. Feedback is permanently linked to the payment transaction on-chain
18
16
19
-
## In the Meantime
17
+
## taskRef Derivation
20
18
21
-
- Read [How It Works](/how-it-works) to understand blind feedback and proof of participation
22
-
- See the [Agent Marketplace](/guides/agent-marketplace) guide for the general feedback flow
23
-
- Check the [sati-agent0-sdk reference](/reference/sati-agent0-sdk) for `giveFeedback` and `prepareFeedback` API details
24
-
- Follow progress on [GitHub](https://github.com/cascade-protocol/sati)
19
+
SATI's `taskRef` is 32 bytes. Solana transaction signatures are 64 bytes. To link them, hash the signature:
20
+
21
+
```typescript
22
+
import { keccak_256 } from"@noble/hashes/sha3";
23
+
importbs58from"bs58";
24
+
25
+
// x402 settlement gives you a base58 transaction signature
26
+
const txSignature =settlementResponse.transaction; // e.g. "5Kj..."
27
+
28
+
// Hash to 32 bytes for SATI taskRef
29
+
const sigBytes =bs58.decode(txSignature);
30
+
const taskRef =keccak_256(sigBytes);
31
+
```
32
+
33
+
This is deterministic - the same payment signature always produces the same `taskRef`. Anyone with the payment tx can verify the link.
34
+
35
+
## Facilitator Integration
36
+
37
+
The facilitator is the natural feedback manager - already in the payment flow, trusted by both parties. Use x402's `onAfterSettle` lifecycle hook:
Copy file name to clipboardExpand all lines: skills/sati/SKILL.md
+90-25Lines changed: 90 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,37 +230,102 @@ For proof-of-participation, use the **FeedbackV1** schema (DualSignature mode).
230
230
231
231
The platform server prepares a SIWS (Sign In With Solana) message, the user signs it in their browser wallet, and the platform submits the transaction.
232
232
233
+
Uses `@solana/wallet-adapter-react` (works with Phantom, Solflare, Backpack, and any wallet implementing the Wallet Standard `signMessage` feature).
> **Note:**`PreparedFeedbackData` contains multiple `Uint8Array` fields (`messageBytes`, `taskRef`, `dataHash`, `content`). If you need to serialize the entire object to JSON (e.g. for a stateless API), convert all `Uint8Array` fields with `bytesToHex()` and restore with `hexToBytes()`. The recommended pattern above avoids this by keeping `prepared` server-side.
328
+
> **Note:**`signMessage` is `undefined` if the connected wallet doesn't support message signing. Always check `signMessage` before calling it. `PreparedFeedbackData` contains multiple `Uint8Array` fields (`messageBytes`, `taskRef`, `dataHash`, `content`). If you need to serialize the entire object to JSON (e.g. for a stateless API), convert all `Uint8Array` fields with `bytesToHex()` and restore with `hexToBytes()`. The recommended pattern above avoids this by keeping `prepared` server-side.
0 commit comments