@telaro/agent-registry-bridge
v0.1.1
Published
Publish Telaro bond / slash / score signals to the ERC-8004 Agent Registry on Solana (QuantuLabs 8004-solana). Permissionless writes.
Maintainers
Readme
@telaro/agent-registry-bridge
Publish Telaro bond, slash, and score signals to the Solana
ERC-8004 Agent Registry
via the permissionless give_feedback instruction.
The Agent Registry is the Solana-native publish surface for agent reputation. Telaro runs the only on-chain bond + slash signal on Solana. Bridging the two means every Agent Registry consumer sees Telaro bond standing without integrating Telaro directly.
Install
npm install @telaro/agent-registry-bridge @solana/web3.jsWhat it ships
| Module | Role |
| --- | --- |
| constants.ts | Devnet + mainnet program ids, Atom engine id, tag conventions |
| mapping.ts | bondAttestation / slashAttestation / scoreAttestation: pure functions from a Telaro signal to a FeedbackArgs |
| instruction.ts | buildGiveFeedbackIx: encodes a FeedbackArgs into a TransactionInstruction against the Agent Registry program |
Two layers so callers can dry-run mapping logic without ever touching Solana, and only opt into the on-chain side when they're ready.
10-second look
import {
AGENT_REGISTRY_DEVNET,
bondAttestation,
buildGiveFeedbackIx,
} from "@telaro/agent-registry-bridge";
import { Connection, Transaction } from "@solana/web3.js";
const args = bondAttestation({
currentBondAtomic: 1_500_000_000n, // 1500 USDC
telaroScore: 720,
});
// args.value = 1_500_000_000n
// args.score = 72 (Telaro 720 / 10)
// args.tag1 = "telaro", args.tag2 = "bond"
const ix = buildGiveFeedbackIx(
AGENT_REGISTRY_DEVNET,
{
client: writerKey.publicKey, // the indexer's key
agentAccount: agentPdaInRegistry, // Agent Registry PDA for the agent
asset: agentAssetMplCore, // backing Metaplex Core asset
collection: agentCollectionMplCore,
},
args,
);
// Assemble + sign + send via your own Connection. The bridge does not.
const tx = new Transaction().add(ix);What goes into each attestation
| Telaro event | value (i128, 6dp) | score (0..100) | tag2 |
| --- | --- | --- | --- |
| Bond standing update | +current_bond_atomic | floor(telaro_score / 10) | bond |
| Claim resolved against agent (slash) | -slashed_atomic | (omitted) | slash |
| Score-only update | 0 | floor(telaro_score / 10) | score |
tag1 is always telaro, so any reader filtering by writer can
pick our attestations out of a mixed feed.
value is signed (i128) so a downstream that sums all the values
gets a net "lifetime bond posted minus lifetime slash" number for
the agent. The Telaro 0..1000 score is compressed by score / 10
into the Agent Registry's 0..100 byte; the full-precision score is
still on the Telaro chain.
Devnet verification
The bridge has been wired end-to-end on devnet. Two real transactions prove the path:
| Step | Transaction signature |
| --- | --- |
| register (Telaro agent into the registry) | 5VzaacAehSpzaXAryUQZYdCbSi836NhGDQnv4a5GppYPaVVnjidPd9hLkk8T7ssD1eKKU1aqGqXofjnRiWJ9TtgL |
| give_feedback (bond attestation via the bridge) | 2dkDcyGUp1oy9wXGStJkuGFcJ6fxEHi9tAiiZ6pqN6RyNsDdLBW4AzMheTkvWM8fkhuBJ1fS7LVDBgYojVSto1cW |
The registered agent (a Telaro test agent) lives at the three
QuantuLabs registry addresses below. The value=1500_000_000 /
score=72 bond attestation is permanently recorded against it.
agent_account 8w8DmvaQM6vVmBnqaLkipFgGUpXpoWNsJuZF2XqSD6Af
asset Fz4HqCL4UTnFqSjLnw1j45ZFkHix1g7Pfwf2pCbUqLXb
collection 6CTyGPcn8dMwKEqgtvx2XCpkGUd7uqCVK6937RSM5bhAReproduce
The repo includes two scripts that, between them, take a fresh devnet keypair to a confirmed attestation.
# 1. Register a fresh Telaro agent into the registry.
# Dry-run first; LIVE=1 sends.
pnpm --filter @telaro/scripts ar-bridge-register-agent
AR_BRIDGE_REGISTER_LIVE=1 pnpm --filter @telaro/scripts ar-bridge-register-agent
# 2. Send a bond attestation against that agent. The writer keypair
# MUST be different from the registering owner (the registry
# rejects self-feedback with Anchor 12300 SelfFeedbackNotAllowed).
AR_BRIDGE_SMOKE_LIVE=1 \
AR_BRIDGE_SMOKE_WRITER_KEYPAIR=/path/to/other-keypair.json \
AR_BRIDGE_SMOKE_AGENT_ACCOUNT=<from-step-1> \
AR_BRIDGE_SMOKE_ASSET=<from-step-1> \
AR_BRIDGE_SMOKE_COLLECTION=<from-step-1> \
pnpm --filter @telaro/scripts ar-bridge-smokeTwo production facts the smoke surfaced
While running this end-to-end we discovered two facts the bridge v0.1 had wrong; both are fixed in the current build.
atom_*andregistry_authorityare mandatory. The IDL marks them as nominally optional, but the registry returns Anchor 3005AccountNotEnoughKeyswhen they're omitted.buildGiveFeedbackIxnow requires them as a complete set (and throws on partial wiring rather than producing a tx that fails on-chain).atom_statsis writable, the other three are readonly.buildGiveFeedbackIxnow sets writability per the IDL flags rather than treating all four as readonly.
Without a real mapping
If you don't have a registered agent yet, the smoke script still
runs in simulate-only mode with placeholder pubkeys and returns
Anchor AccountNotInitialized (3012) from inside the registry,
proving the wire path up to account validation.
pnpm --filter @telaro/scripts ar-bridge-smokeWhat this package is not
- It is not a long-running worker. There is no event loop here. Callers wire this into their own indexer or trigger from an event bus.
- It is not an SDK for the rest of the Agent Registry. Only the
give_feedbackwrite path is encoded.revoke_feedbackandappend_responseare reserved for later versions. - It does not derive the agent's PDA in the Agent Registry. The
caller passes
agentAccountdirectly. The PDA seeds are defined by the registry program; the bridge intentionally stays out of cross-program PDA assumptions until that derivation is part of an official SDK.
License
MIT.
