Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions poc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node_modules

# Output
.output
.netlify
dist

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Astro
.astro/

# Claude Code
.claude/

# Playwright MCP
.playwright-mcp/

# Astro (generated)
website/.astro/
website/dist/

75 changes: 75 additions & 0 deletions poc/C-didkey-originated.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { xrpcSafe } from '@atproto/lex'
import * as com from './lexicons/com.js'
import * as app from './lexicons/app.js'

async function runExperimentC() {
const mockDidKey = 'did:key:z6MkhaXgBZDvotDkL5257faiztiuC2Q3hA4Kpm8o1eM3QGwk'
const pdsUrl = 'https://bsky.social'

console.log(`\n==================================================`)
console.log(`[Experiment C-1] Testing did:key natively against AT Protocol`)
console.log(`==================================================\n`)

console.log(`-> 1. Trying describeRepo with did:key...`)
const describeResult = await xrpcSafe(pdsUrl, com.atproto.repo.describeRepo, {
params: { repo: mockDidKey }
})

if (!describeResult.success) {
console.log(` [Rejected] Error: ${describeResult.error}`)
console.log(` [Message] ${describeResult.message}\n`)
}

console.log(`-> 2. Trying createRecord with did:key...`)
const createResult = await xrpcSafe(pdsUrl, com.atproto.repo.createRecord, {
data: {
repo: mockDidKey,
collection: 'app.bsky.feed.post',
record: {
$type: 'app.bsky.feed.post',
text: 'Hello from did:key! Is this allowed?',
createdAt: new Date().toISOString()
}
}
})

if (!createResult.success) {
console.log(` [Rejected] Error: ${createResult.error}`)
console.log(` [Message] ${createResult.message}\n`)
}
}

async function runExperimentC2() {
const mockDidKey = 'did:key:z6MkhaXgBZDvotDkL5257faiztiuC2Q3hA4Kpm8o1eM3QGwk'
const pdsUrl = 'https://bsky.social'

console.log(`\n==================================================`)
console.log(`[Experiment C-2] Trying to CREATE AN ACCOUNT with did:key...`)
console.log(`==================================================\n`)

const createAccountResult = await xrpcSafe(pdsUrl, com.atproto.server.createAccount, {
data: {
did: mockDidKey,
handle: 'didkey-test.bsky.social',
email: 'dummy-didkey@example.com',
password: 'SuperSecretPassword123!',
inviteCode: 'dummy-code' // PDSによっては必要になるのでダミーを入れておきます
}
})

if (!createAccountResult.success) {
console.log(` ❌ [Rejected] Error: ${createAccountResult.error}`)
console.log(` ❌ [Message] ${createAccountResult.message}\n`)
console.log('💡 結論: あなたの予想通り、PDSは did:key での「アカウント作成」自体を明確に拒絶しました。')
} else {
console.log('🎉 成功!? サーバーが did:key でのアカウント作成を許可しました!')
}
}

// 順番に実行するためのラッパー
async function main() {
await runExperimentC()
await runExperimentC2()
}

main()
107 changes: 107 additions & 0 deletions poc/lexicons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"version": 1,
"lexicons": [
"app.bsky.feed.post",
"com.atproto.repo.createRecord",
"com.atproto.repo.describeRepo",
"com.atproto.server.createAccount"
],
"resolutions": {
"app.bsky.actor.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.defs",
"cid": "bafyreigwqwhe2jxohagozazfbrf6dxgzphvkg3d3lg7uxdvepsimqyclka"
},
"app.bsky.actor.status": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.status",
"cid": "bafyreifdg4b64wohpwkh5lydc6tckvol2rspnpni6dec6recy2rhvlnz4a"
},
"app.bsky.embed.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.defs",
"cid": "bafyreia42uud4qil67wknywzbxfyxc3b7woewsii54cakq2ould3ldetei"
},
"app.bsky.embed.external": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.external",
"cid": "bafyreiblxmpzgwg4fbr45b4xzts3h4k72k7cdnrxy2ub2w5d7mnwzznkwi"
},
"app.bsky.embed.images": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.images",
"cid": "bafyreifrntpx63uebiskpooozv6hji62swectq3pocw5h5gpkkqynmazdm"
},
"app.bsky.embed.record": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.record",
"cid": "bafyreigdtmu53blwxoygphg5zh5zpmlftz64c3jyqpv2yqpx3nrichkyla"
},
"app.bsky.embed.recordWithMedia": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.recordWithMedia",
"cid": "bafyreia7jrw2p73egm7vrunssgzeyj2rwmk3s4dymfhgzcavxjfaje3qfi"
},
"app.bsky.embed.video": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.video",
"cid": "bafyreie3nug4ezpwodl6yrpgv5edkazzn22t7ea4yaeuun4rctyekkngai"
},
"app.bsky.feed.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.defs",
"cid": "bafyreiadwvxawxifsnm7ae6l56aq23qs7ndih7npgs6pxmkoin7gi3k6pu"
},
"app.bsky.feed.post": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.post",
"cid": "bafyreidgbehqwweghrrddfu6jgj7lyr6fwhzgazhirnszdb5lvr7iynkiy"
},
"app.bsky.feed.postgate": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.postgate",
"cid": "bafyreiai5efexyluyptv5tbl6kqbqlnneczqzexcqnxmitmulyjfaftgva"
},
"app.bsky.feed.threadgate": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.threadgate",
"cid": "bafyreiht77wd6duduz4yqp62m6dwma5dy7gdihps4g2nd73acfzqlglvdi"
},
"app.bsky.graph.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.graph.defs",
"cid": "bafyreifcipomli7yggtl46xufgxlnrw7se6xmsdxmzgfcz2tiu76ljatxm"
},
"app.bsky.labeler.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.labeler.defs",
"cid": "bafyreicxx5i36v5dbqk5vvfzhnta5gajrvc544mnepux4wksrkid7mw3q4"
},
"app.bsky.notification.defs": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.notification.defs",
"cid": "bafyreickbpnayydlyfakliahgf23jjuesllh6qrslyofk5yz5xizjavhui"
},
"app.bsky.richtext.facet": {
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.richtext.facet",
"cid": "bafyreidg56eo7zynf6ihz4xb627vwoqf5idnevkmwp7sxc4tijg6xngbu4"
},
"com.atproto.label.defs": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.defs",
"cid": "bafyreig4hmnb2xkecyg4aaqfhr2rrcxxb3gsr4xks4rqb7rscrycalbrji"
},
"com.atproto.moderation.defs": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.moderation.defs",
"cid": "bafyreideawy4rlpgces2oebk5q4kpurbonhb5qtl4pes7dvxsc5osaiksy"
},
"com.atproto.repo.createRecord": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.createRecord",
"cid": "bafyreihyvpmy2l4ou2v5etx25j5lbqty6tvna7gsxdqge76rbb7gltulei"
},
"com.atproto.repo.defs": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.defs",
"cid": "bafyreigmp5xfpkhnmwr3l5o626ued2gc2ouioykj2tpgqjqqajvbvm3wlm"
},
"com.atproto.repo.describeRepo": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.describeRepo",
"cid": "bafyreif5ho6rtknjmiqjclrfogiqyzxnix2fzpwxyftfebplkj4q23pnrm"
},
"com.atproto.repo.strongRef": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.strongRef",
"cid": "bafyreifrkdbnkvfjujntdaeigolnrjj3srrs53tfixjhmacclps72qlov4"
},
"com.atproto.server.createAccount": {
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.createAccount",
"cid": "bafyreie6o2sq47ukysnnnwxcb7eocpyyazetp5n3m4u3n5f7v5xr7qn62u"
},
"tools.ozone.report.defs": {
"uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.report.defs",
"cid": "bafyreic3l2rmh2ugirt3jz372wcvy333m7t2ynlyzj2k54oshijs6lxdfu"
}
}
}
5 changes: 5 additions & 0 deletions poc/lexicons/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
*/

export * as bsky from './app/bsky.js'
11 changes: 11 additions & 0 deletions poc/lexicons/app/bsky.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
*/

export * as actor from './bsky/actor.js'
export * as embed from './bsky/embed.js'
export * as feed from './bsky/feed.js'
export * as graph from './bsky/graph.js'
export * as labeler from './bsky/labeler.js'
export * as notification from './bsky/notification.js'
export * as richtext from './bsky/richtext.js'
6 changes: 6 additions & 0 deletions poc/lexicons/app/bsky/actor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
*/

export * as defs from './actor/defs.js'
export * as status from './actor/status.js'
Loading