@svsprotocol/solana 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +158 -0
- package/README.md +365 -0
- package/dist/action-production-proof-evidence.js +553 -0
- package/dist/adapter-catalog.d.ts +29 -0
- package/dist/adapter-catalog.js +146 -0
- package/dist/adapter-core.d.ts +48 -0
- package/dist/adapter-core.js +249 -0
- package/dist/approval-signature.js +197 -0
- package/dist/base58.js +69 -0
- package/dist/bot-auth.js +50 -0
- package/dist/bot-certification-evidence.js +342 -0
- package/dist/bot-first-action-runbook.js +299 -0
- package/dist/bot-integration-contract.js +41 -0
- package/dist/certified-submit-status.js +176 -0
- package/dist/common.d.ts +1135 -0
- package/dist/elizaos.d.ts +43 -0
- package/dist/elizaos.js +227 -0
- package/dist/goat.d.ts +47 -0
- package/dist/goat.js +261 -0
- package/dist/index.d.ts +330 -0
- package/dist/index.js +128 -0
- package/dist/protocol.d.ts +205 -0
- package/dist/protocol.js +900 -0
- package/dist/receipt.js +51 -0
- package/dist/signed-proof-read-protection.js +495 -0
- package/dist/solana-agent-kit.d.ts +35 -0
- package/dist/solana-agent-kit.js +151 -0
- package/dist/svs-client.js +1232 -0
- package/dist/vercel-ai.d.ts +47 -0
- package/dist/vercel-ai.js +266 -0
- package/dist/verified-agent-adoption-kit.js +471 -0
- package/dist/verified-agent-profile.js +329 -0
- package/dist/verified-agent-registry-consumer.js +421 -0
- package/dist/verified-agent-registry.d.ts +36 -0
- package/dist/verified-agent-registry.js +826 -0
- package/dist/verified-agent-trust-score.js +335 -0
- package/dist/webhooks.js +834 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
34
|
+
made available under the License, as indicated by a copyright notice that is
|
|
35
|
+
included in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
47
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
48
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
49
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
50
|
+
to the Licensor or its representatives, including but not limited to
|
|
51
|
+
communication on electronic mailing lists, source code control systems, and
|
|
52
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
53
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
54
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
55
|
+
owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable patent license to make, have made, use,
|
|
71
|
+
offer to sell, sell, import, and otherwise transfer the Work, where such license
|
|
72
|
+
applies only to those patent claims licensable by such Contributor that are
|
|
73
|
+
necessarily infringed by their Contribution(s) alone or by combination of their
|
|
74
|
+
Contribution(s) with the Work to which such Contribution(s) was submitted. If
|
|
75
|
+
You institute patent litigation against any entity (including a cross-claim or
|
|
76
|
+
counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated
|
|
77
|
+
within the Work constitutes direct or contributory patent infringement, then any
|
|
78
|
+
patent licenses granted to You under this License for that Work shall terminate
|
|
79
|
+
as of the date such litigation is filed.
|
|
80
|
+
|
|
81
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
82
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
83
|
+
Source or Object form, provided that You meet the following conditions:
|
|
84
|
+
|
|
85
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
86
|
+
this License; and
|
|
87
|
+
|
|
88
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
89
|
+
You changed the files; and
|
|
90
|
+
|
|
91
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
92
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
93
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
94
|
+
of the Derivative Works; and
|
|
95
|
+
|
|
96
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
97
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
98
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
99
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
100
|
+
following places: within a NOTICE text file distributed as part of the
|
|
101
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
102
|
+
with the Derivative Works; or within a display generated by the Derivative
|
|
103
|
+
Works, if and wherever such third-party notices normally appear. The contents
|
|
104
|
+
of the NOTICE file are for informational purposes only and do not modify the
|
|
105
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
106
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
107
|
+
provided that such additional attribution notices cannot be construed as
|
|
108
|
+
modifying the License.
|
|
109
|
+
|
|
110
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
111
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
112
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
113
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
114
|
+
with the conditions stated in this License.
|
|
115
|
+
|
|
116
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
117
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
118
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
119
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
120
|
+
supersede or modify the terms of any separate license agreement You may have
|
|
121
|
+
executed with Licensor regarding such Contributions.
|
|
122
|
+
|
|
123
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
124
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
125
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
126
|
+
reproducing the content of the NOTICE file.
|
|
127
|
+
|
|
128
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
129
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
130
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
131
|
+
KIND, either express or implied, including, without limitation, any warranties or
|
|
132
|
+
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
133
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
134
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
135
|
+
associated with Your exercise of permissions under this License.
|
|
136
|
+
|
|
137
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
138
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
139
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
140
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
141
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
142
|
+
arising as a result of this License or out of the use or inability to use the
|
|
143
|
+
Work, including but not limited to damages for loss of goodwill, work stoppage,
|
|
144
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
145
|
+
losses, even if such Contributor has been advised of the possibility of such
|
|
146
|
+
damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
149
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
150
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
151
|
+
and/or rights consistent with this License. However, in accepting such
|
|
152
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
153
|
+
responsibility, not on behalf of any other Contributor, and only if You agree to
|
|
154
|
+
indemnify, defend, and hold each Contributor harmless for any liability incurred
|
|
155
|
+
by, or claims asserted against, such Contributor by reason of your accepting any
|
|
156
|
+
such warranty or additional liability.
|
|
157
|
+
|
|
158
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# @svsprotocol/solana
|
|
2
|
+
|
|
3
|
+
Client SDK boundary for `SVS: Solana Verification System`.
|
|
4
|
+
|
|
5
|
+
Use this package when a Solana bot or agent needs one trusted path to submit an action, prove signed bot identity, require human/operator approval, fetch production proof, and expose a verified-agent profile or badge.
|
|
6
|
+
|
|
7
|
+
This package intentionally exports only bot/client/protocol-safe APIs:
|
|
8
|
+
|
|
9
|
+
- `SolanaVerificationClient`
|
|
10
|
+
- `createSignedBotRequest`
|
|
11
|
+
- certified-submit status helpers
|
|
12
|
+
- action production proof verification helpers
|
|
13
|
+
- verified agent profile and badge helpers
|
|
14
|
+
- deterministic verified-agent trust score helpers
|
|
15
|
+
- signed proof-read verification helpers
|
|
16
|
+
- webhook signature verification helpers
|
|
17
|
+
- `requireVerifiedAgent` from `@svsprotocol/solana/protocol`
|
|
18
|
+
- custom adapter primitives from `@svsprotocol/solana/adapter-core`
|
|
19
|
+
- typed adapter discovery from `@svsprotocol/solana/adapter-catalog`
|
|
20
|
+
- ElizaOS adapter helpers from `@svsprotocol/solana/elizaos`
|
|
21
|
+
- GOAT adapter helpers from `@svsprotocol/solana/goat`
|
|
22
|
+
- Solana Agent Kit adapter helpers from `@svsprotocol/solana/solana-agent-kit`
|
|
23
|
+
- Vercel AI SDK adapter helpers from `@svsprotocol/solana/vercel-ai`
|
|
24
|
+
|
|
25
|
+
Dashboard, local admin, release, registry-authority, and server internals stay in the main application package.
|
|
26
|
+
|
|
27
|
+
## License and Boundary
|
|
28
|
+
|
|
29
|
+
`@svsprotocol/solana` is the public client/adoption SDK and is licensed under Apache-2.0. That license applies only to this package as published. It does not grant rights to the private SVS operator dashboard, server, registry authority, release tooling, deployment evidence, signing keys, hosted registry operations, badges, domains, or trademarks.
|
|
30
|
+
|
|
31
|
+
The package should remain limited to `README.md`, `LICENSE`, `package.json`, and built `dist/*.js` / `dist/*.d.ts` files. Generated evidence, dashboard files, release bundles, local credentials, wallets, keypairs, `.env`, `.devnet`, tests, and examples must stay out of the npm artifact.
|
|
32
|
+
|
|
33
|
+
The package ships TypeScript declarations for the root SDK and every public adapter/protocol export. `npm run sdk:check` compiles a real TypeScript consumer against `@svsprotocol/solana` and its subpath exports, so bot teams get checked action payloads, adapter results, verified-agent profiles, registry verification results, and protocol acceptance checks without needing to inspect the dashboard internals.
|
|
34
|
+
|
|
35
|
+
`npm run sdk:check` also runs the public-package hygiene gate. It uses `npm pack --dry-run` to verify that the publishable tarball only contains `README.md`, `package.json`, and `dist/*.js` / `dist/*.d.ts`; generated evidence, dashboard files, release bundles, credentials, keypairs, wallets, local env files, examples, and tests must stay out of the SDK artifact.
|
|
36
|
+
|
|
37
|
+
The same hygiene gate compares every public runtime export path against the matching TypeScript declaration file, so a new SDK/helper export cannot ship without a typed public contract.
|
|
38
|
+
|
|
39
|
+
TypeScript-first bot teams can start from the public typed consumer example:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm run example:typescript:agent
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That command compiles `examples/typescript/typed-agent-consumer/typed-agent-consumer.ts`, and the external-consumer release proof compiles the same file after installing the packed SDK into a clean temporary app.
|
|
46
|
+
|
|
47
|
+
## Bot Builder Fast Path
|
|
48
|
+
|
|
49
|
+
1. Install `@svsprotocol/solana`.
|
|
50
|
+
2. Fill `SVS_SERVER_URL`, `SVS_BOT_ID`, `SVS_BOT_API_KEY`, `SVS_BOT_REQUEST_SIGNING_SECRET`, and `SVS_BOT_EXPECTED_INTEGRATION_CONTRACT_HASH`.
|
|
51
|
+
3. Run `client.checkBotReadiness({ botId })` at startup.
|
|
52
|
+
4. Submit with `client.submitCertifiedActionAndWaitForProof(...)` for the full signed request, human approval, registry proof, and proof-fetch path.
|
|
53
|
+
5. Use `verifyVerifiedAgentProfile`, `verifyVerifiedAgentRegistryUrl`, or `requireVerifiedAgent` when a protocol, marketplace, or auditor needs to re-check the bot.
|
|
54
|
+
|
|
55
|
+
Framework teams can use the same path through `@svsprotocol/solana/solana-agent-kit`, `@svsprotocol/solana/elizaos`, `@svsprotocol/solana/goat`, or `@svsprotocol/solana/vercel-ai`.
|
|
56
|
+
|
|
57
|
+
Tools that generate bot integrations can use the typed adapter catalog instead of scraping docs:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import {
|
|
61
|
+
findSvsAgentFrameworkAdapter,
|
|
62
|
+
getSvsAgentFrameworkAdapters
|
|
63
|
+
} from "@svsprotocol/solana/adapter-catalog";
|
|
64
|
+
|
|
65
|
+
const adapters = getSvsAgentFrameworkAdapters({ primaryOnly: true });
|
|
66
|
+
for (const adapter of adapters) {
|
|
67
|
+
console.log(adapter.runtime, adapter.packageExport, adapter.demoCommand);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const eliza = findSvsAgentFrameworkAdapter("SVS_VERIFY_AND_SUBMIT_SOLANA_ACTION");
|
|
71
|
+
console.log(eliza.packageExport); // @svsprotocol/solana/elizaos
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
SVS host-app validation also requires primary adapters to emit this catalog binding proof. That lets a protocol or bot team verify that a Solana Agent Kit tool or ElizaOS action was loaded from the public SDK adapter catalog, not from an undocumented copy of the adapter contract.
|
|
75
|
+
|
|
76
|
+
## Adapter Matrix
|
|
77
|
+
|
|
78
|
+
| Bot runtime | Package export | Tool/action | Demo |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| Custom agent runtime | `@svsprotocol/solana/adapter-core` | shared readiness and certified-submit primitives | TypeScript consumer example |
|
|
81
|
+
| Solana Agent Kit | `@svsprotocol/solana/solana-agent-kit` | `svs_verify_and_submit_solana_action` | `npm run example:agent:solana-kit` |
|
|
82
|
+
| ElizaOS | `@svsprotocol/solana/elizaos` | `SVS_VERIFY_AND_SUBMIT_SOLANA_ACTION` | `npm run example:agent:elizaos` |
|
|
83
|
+
| GOAT | `@svsprotocol/solana/goat` | `svs_verify_and_submit_solana_action` | `npm run example:agent:goat` |
|
|
84
|
+
| Vercel AI SDK | `@svsprotocol/solana/vercel-ai` | `svsVerifyAndSubmitSolanaAction` | `npm run example:agent:vercel-ai` |
|
|
85
|
+
|
|
86
|
+
Before public release, `npm run agent:host-validate` packs this SDK, installs it into a custom adapter-core host and minimal real Solana Agent Kit, ElizaOS, GOAT SDK, and Vercel AI SDK host apps, submits through the adapter/plugin/tool, then verifies the returned action record's production proof and current SVS approval domain. That gives bot teams a host-app proof instead of only a workspace import test.
|
|
87
|
+
|
|
88
|
+
Custom agent runtimes should use `@svsprotocol/solana/adapter-core` instead of importing private SDK internals. It exposes the shared readiness and certified-submit helpers used by the first-party adapters, so a new framework can get the same fail-closed production certification, human approval queueing, proof wait, and typed adapter result contract without copying adapter logic.
|
|
89
|
+
|
|
90
|
+
## Real Agent Category Demos
|
|
91
|
+
|
|
92
|
+
| Agent category | Purpose | Demo |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| DeFi risk gate | Devnet Memo risk intent with protocol/notional/health-factor/LTV policy and human approval | `npm run example:agent:defi-risk` |
|
|
95
|
+
| NFT mint agent | Devnet Memo mint intent with collection/metadata/quantity/fee policy and human approval | `npm run example:agent:nft-mint` |
|
|
96
|
+
| Payment agent | Small devnet SOL transfer through the certified action path | `npm run example:agent:payment` |
|
|
97
|
+
| Trading agent | Devnet Memo trade intent with pair/notional/slippage policy and human approval | `npm run example:agent:trading` |
|
|
98
|
+
| Treasury agent | Larger devnet SOL transfer that locally proves `multisig_required` before submit | `npm run example:agent:treasury` |
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import { SolanaVerificationClient } from "@svsprotocol/solana";
|
|
102
|
+
|
|
103
|
+
const svs = new SolanaVerificationClient({
|
|
104
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
105
|
+
apiKey: process.env.SVS_BOT_API_KEY,
|
|
106
|
+
requestSigningSecret: process.env.SVS_BOT_REQUEST_SIGNING_SECRET
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
await svs.checkBotReadiness({ botId: process.env.SVS_BOT_ID });
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Verified agent profile:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import {
|
|
116
|
+
createVerifiedAgentBadgeSvg,
|
|
117
|
+
verifyVerifiedAgentProfile
|
|
118
|
+
} from "@svsprotocol/solana";
|
|
119
|
+
|
|
120
|
+
const verification = verifyVerifiedAgentProfile(profile, {
|
|
121
|
+
expectedBotId: process.env.SVS_BOT_ID,
|
|
122
|
+
staleAfterMs: 24 * 60 * 60 * 1000
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
if (!verification.ok) {
|
|
126
|
+
throw new Error("SVS verified agent profile is not current.");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const badgeSvg = createVerifiedAgentBadgeSvg(profile);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Static registry export:
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
npm run bot:registry -- \
|
|
136
|
+
--profile ./data/security/verified-agent-profile.json \
|
|
137
|
+
--badge ./data/security/verified-agent-badge.svg \
|
|
138
|
+
--out ./data/verified-agent-registry
|
|
139
|
+
|
|
140
|
+
npm run verify:verified-agent-registry -- \
|
|
141
|
+
--file ./data/verified-agent-registry/registry.json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The registry directory includes `registry.json`, `trust-manifest.json`, `index.html`, and per-agent profile/badge pages. Host those files privately or publicly to give protocols, auditors, and users one inspectable trust page with the pinned registry hash, verifier commands, proof freshness, and required checks.
|
|
145
|
+
The hosted/self-hosted product target is documented in `docs/hosted-registry-trust-surface.md` at the repo root, including route shape, badge states, protocol allowlists, privacy modes, caching, and production gates.
|
|
146
|
+
|
|
147
|
+
Create a non-secret adoption handoff after the registry is hosted:
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
import { createVerifiedAgentAdoptionKit } from "@svsprotocol/solana";
|
|
151
|
+
|
|
152
|
+
const kit = createVerifiedAgentAdoptionKit({
|
|
153
|
+
profile,
|
|
154
|
+
registry,
|
|
155
|
+
registryUrl: process.env.SVS_VERIFIED_AGENT_REGISTRY_URL,
|
|
156
|
+
expectedRegistryHash: process.env.SVS_VERIFIED_AGENT_REGISTRY_HASH
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
console.log(kit.copy.protocolEnv);
|
|
160
|
+
console.log(kit.copy.sdkSnippet);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The kit packages the pinned registry URL/hash, profile and badge URLs, protocol env, SDK middleware snippet, verifier commands, and checklist without bot API keys or request-signing secrets.
|
|
164
|
+
|
|
165
|
+
Verify a hosted registry from a bot, protocol service, or auditor machine. This checks the remote registry hash, `trust-manifest.json`, linked profile hashes, profile freshness, verifier instructions, and secret-safety metadata:
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
import { verifyVerifiedAgentRegistryUrl } from "@svsprotocol/solana";
|
|
169
|
+
|
|
170
|
+
const result = await verifyVerifiedAgentRegistryUrl({
|
|
171
|
+
registryUrl: process.env.SVS_VERIFIED_AGENT_REGISTRY_URL,
|
|
172
|
+
expectedRegistryHash: process.env.SVS_VERIFIED_AGENT_REGISTRY_HASH
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (!result.ok) {
|
|
176
|
+
throw new Error("SVS verified-agent registry failed verification.");
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Create an explainable trust-score table from already-verified evidence:
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
import {
|
|
184
|
+
VERIFIED_AGENT_TRUST_SCORE_POLICY,
|
|
185
|
+
createVerifiedAgentTrustScore
|
|
186
|
+
} from "@svsprotocol/solana";
|
|
187
|
+
|
|
188
|
+
const score = createVerifiedAgentTrustScore({
|
|
189
|
+
profile,
|
|
190
|
+
profileVerification,
|
|
191
|
+
registryVerification,
|
|
192
|
+
actionProductionProofEvidence,
|
|
193
|
+
actionProductionProofVerification,
|
|
194
|
+
credentialReadiness,
|
|
195
|
+
hostValidation
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
console.log(score.score, score.status, score.nextAction.message);
|
|
199
|
+
console.log(VERIFIED_AGENT_TRUST_SCORE_POLICY.requiredSignalIds);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The score is deterministic and hashable. It helps protocols compare agents by visible evidence signals, but it does not replace the required profile, registry, production-proof, and approval-domain verifier checks. High trust requires at least `90 / 100` plus all required signals. See `docs/agent-trust-score-policy.md` for the full signal table.
|
|
203
|
+
|
|
204
|
+
Protocol middleware:
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
import { createHostedVerifiedAgentRegistryMiddleware } from "@svsprotocol/solana/protocol";
|
|
208
|
+
|
|
209
|
+
const requireSvsAgent = createHostedVerifiedAgentRegistryMiddleware({
|
|
210
|
+
registryUrl: process.env.SVS_VERIFIED_AGENT_REGISTRY_URL,
|
|
211
|
+
expectedRegistryHash: process.env.SVS_VERIFIED_AGENT_REGISTRY_HASH
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
await requireSvsAgent({ botId: "devnet-treasury-agent-001" });
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
This rejects agents that are not listed in the pinned registry or whose hosted `trust-manifest.json` or linked profile fails verification.
|
|
218
|
+
|
|
219
|
+
## Approval Domain Migration
|
|
220
|
+
|
|
221
|
+
New production proofs should use the current SVS approval domain:
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
svs-solana-verification-system
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
The legacy domain is still verifier-compatible so older exported receipts and audit bundles remain inspectable:
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
solana-human-verification-system
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Bots, protocols, and auditors should treat `humanApproval.domainStatus === "current"` as the production-ready path for new actions. Treat `legacy_compatible` as migration/audit compatibility only; it means the approval can still be verified, but the action was signed under the previous product domain.
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
import {
|
|
237
|
+
verifyActionProductionProofEvidence
|
|
238
|
+
} from "@svsprotocol/solana";
|
|
239
|
+
import {
|
|
240
|
+
requireCurrentApprovalDomain
|
|
241
|
+
} from "@svsprotocol/solana/protocol";
|
|
242
|
+
|
|
243
|
+
const verification = verifyActionProductionProofEvidence(proofEvidence, {
|
|
244
|
+
expectedRecordId: proofEvidence.productionProof.recordId,
|
|
245
|
+
staleAfterMs: 24 * 60 * 60 * 1000
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
if (!verification.ok) {
|
|
249
|
+
throw new Error("SVS production proof failed verification.");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
requireCurrentApprovalDomain(proofEvidence, { action: "swap" });
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
For historical audit imports, display `legacy_compatible` clearly instead of hiding it. It is useful evidence for old bundles, but new bot integrations should produce `current`.
|
|
256
|
+
|
|
257
|
+
Protocol-side check:
|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
import { requireVerifiedAgent } from "@svsprotocol/solana/protocol";
|
|
261
|
+
|
|
262
|
+
await requireVerifiedAgent({
|
|
263
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
264
|
+
apiKey: process.env.SVS_PROTOCOL_API_KEY,
|
|
265
|
+
botId: "jupiter-rebalancer-001",
|
|
266
|
+
action: "swap",
|
|
267
|
+
minCertification: "production_verified"
|
|
268
|
+
});
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Copyable protocol demo. This checks production certification plus the exact action record's production proof and current SVS approval domain:
|
|
272
|
+
|
|
273
|
+
```sh
|
|
274
|
+
npm run example:protocol:verified-agent-gate -- \
|
|
275
|
+
--env ./examples/protocols/verified-agent-gate-demo/verified-agent-gate-demo.local.env
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
ElizaOS adapter:
|
|
279
|
+
|
|
280
|
+
```js
|
|
281
|
+
import { createSvsElizaOsPlugin } from "@svsprotocol/solana/elizaos";
|
|
282
|
+
|
|
283
|
+
export const svsPlugin = createSvsElizaOsPlugin({
|
|
284
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
285
|
+
apiKey: process.env.SVS_BOT_API_KEY,
|
|
286
|
+
requestSigningSecret: process.env.SVS_BOT_REQUEST_SIGNING_SECRET,
|
|
287
|
+
expectedIntegrationContractHash: process.env.SVS_BOT_EXPECTED_INTEGRATION_CONTRACT_HASH,
|
|
288
|
+
botId: process.env.SVS_BOT_ID,
|
|
289
|
+
policyId: "memo-human-approved-v1",
|
|
290
|
+
rpcUrl: process.env.SOLANA_RPC_URL
|
|
291
|
+
});
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Solana Agent Kit adapter:
|
|
295
|
+
|
|
296
|
+
```js
|
|
297
|
+
import { createSvsSolanaAgentKitAdapter } from "@svsprotocol/solana/solana-agent-kit";
|
|
298
|
+
|
|
299
|
+
const svsTool = createSvsSolanaAgentKitAdapter({
|
|
300
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
301
|
+
apiKey: process.env.SVS_BOT_API_KEY,
|
|
302
|
+
requestSigningSecret: process.env.SVS_BOT_REQUEST_SIGNING_SECRET,
|
|
303
|
+
expectedIntegrationContractHash: process.env.SVS_BOT_EXPECTED_INTEGRATION_CONTRACT_HASH,
|
|
304
|
+
botId: process.env.SVS_BOT_ID,
|
|
305
|
+
policyId: "memo-human-approved-v1",
|
|
306
|
+
rpcUrl: process.env.SOLANA_RPC_URL
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
await svsTool.requireSvsProductionReady();
|
|
310
|
+
|
|
311
|
+
const result = await svsTool.verifyAndSubmitSolanaAction({
|
|
312
|
+
requestId,
|
|
313
|
+
intent,
|
|
314
|
+
serializedTransaction
|
|
315
|
+
});
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
GOAT adapter:
|
|
319
|
+
|
|
320
|
+
```js
|
|
321
|
+
import { createSvsGoatPlugin } from "@svsprotocol/solana/goat";
|
|
322
|
+
|
|
323
|
+
const svsGoat = createSvsGoatPlugin({
|
|
324
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
325
|
+
apiKey: process.env.SVS_BOT_API_KEY,
|
|
326
|
+
requestSigningSecret: process.env.SVS_BOT_REQUEST_SIGNING_SECRET,
|
|
327
|
+
expectedIntegrationContractHash: process.env.SVS_BOT_EXPECTED_INTEGRATION_CONTRACT_HASH,
|
|
328
|
+
botId: process.env.SVS_BOT_ID,
|
|
329
|
+
policyId: "memo-human-approved-v1",
|
|
330
|
+
rpcUrl: process.env.SOLANA_RPC_URL
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
await svsGoat.requireSvsProductionReady();
|
|
334
|
+
|
|
335
|
+
const [tool] = svsGoat.getTools();
|
|
336
|
+
const result = await tool.execute({
|
|
337
|
+
requestId,
|
|
338
|
+
intent,
|
|
339
|
+
serializedTransaction
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Vercel AI SDK adapter:
|
|
344
|
+
|
|
345
|
+
```js
|
|
346
|
+
import { tool } from "ai";
|
|
347
|
+
import { z } from "zod";
|
|
348
|
+
import { createSvsVercelAiSdkTools } from "@svsprotocol/solana/vercel-ai";
|
|
349
|
+
|
|
350
|
+
const svs = createSvsVercelAiSdkTools({
|
|
351
|
+
tool,
|
|
352
|
+
z,
|
|
353
|
+
baseUrl: process.env.SVS_SERVER_URL,
|
|
354
|
+
apiKey: process.env.SVS_BOT_API_KEY,
|
|
355
|
+
requestSigningSecret: process.env.SVS_BOT_REQUEST_SIGNING_SECRET,
|
|
356
|
+
expectedIntegrationContractHash: process.env.SVS_BOT_EXPECTED_INTEGRATION_CONTRACT_HASH,
|
|
357
|
+
botId: process.env.SVS_BOT_ID,
|
|
358
|
+
policyId: "memo-human-approved-v1",
|
|
359
|
+
rpcUrl: process.env.SOLANA_RPC_URL
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
await svs.requireSvsProductionReady();
|
|
363
|
+
|
|
364
|
+
const tools = svs.getTools();
|
|
365
|
+
```
|