Skip to content

Instantly share code, notes, and snippets.

@cboscolo
cboscolo / atrecord.ts
Created July 25, 2025 19:02
AT Protocol record maintenance
import { AtpAgent } from '@atproto/api';
import { verifySignature } from '@atproto/crypto';
import * as dagCbor from '@ipld/dag-cbor'
import { CarReader } from '@ipld/car';
import { CID } from 'multiformats/cid';
import { DidResolver } from '@atproto/identity';
//
// To run:
// bun run atrecord.ts verify "at://did:plc:example123/app.bsky.feed.post/abc123"
@cboscolo
cboscolo / verify-atrecord.ts
Created May 28, 2025 21:23
Lookup an AT Protocol record in the form at://did/collection/rkey and verify the commit signature.
import { AtpAgent } from '@atproto/api';
import { verifySignature } from '@atproto/crypto';
import * as dagCbor from '@ipld/dag-cbor'
import { CarReader } from '@ipld/car';
import { CID } from 'multiformats/cid';
import { DidResolver } from '@atproto/identity';
//
// To run:
// bun verify-record.ts "at://did:plc:example123/app.bsky.feed.post/abc123"
Farcaster Channels are erc721 token contract addresses encoded using Farcaster's FIP-1 Canonical URI syntax.
It appears as though some channels were created on Mainnet and some were created on Zora
As an example, the Soccer channel uses this URL: chain://eip155:1/erc721:0x7abFE142031532e1ad0e46f971CC0Ef7Cf4b98b0
Mainnet
Soccer ($SOCCER): chain://eip155:1/erc721:0x7abFE142031532e1ad0e46f971CC0Ef7Cf4b98b0
Art ($ART): chain://eip155:1/erc721:0x1538c5DdBb073638b7cD1Ae41EC2D9f9A4C24a7e
NY ($NY): chain://eip155:1/erc721:0xfdD5e7949BD72C95907c46A630d2C791f0E842c6
Electronic ($ELECTRON...): chain://eip155:1/erc721:0x05aCDe54e82e7E38ec12c5B5b4B1fd1c8D32658D
@cboscolo
cboscolo / gist:e6eff4c36c665d4d3d8a8ac656ae302e
Last active October 16, 2018 17:32
Example Rholang contract manager
new mapStore, PackageManager, register(`rho:registry:insertArbitrary`) in {
// Create the map of contract versions
mapStore!({}) |
// Store the PackageManager at a unique id. If you want to send the id to
// another contract, replace Nil with *<contract name>.
register!(bundle+{*PackageManager}, Nil) |
// Claim a new package name
contract PackageManager(@"newPackage", @packageName, return) = {
for (@map <- mapStore) {