diff --git a/shared/challenges_markdown/three/part_one.md b/shared/challenges_markdown/three/part_one.md index d2d534e..147bc11 100644 --- a/shared/challenges_markdown/three/part_one.md +++ b/shared/challenges_markdown/three/part_one.md @@ -1,43 +1,101 @@ -To recap: [records](https://atproto.com/guides/glossary#record) are kept in [repo](https://atproto.com/guides/glossary#data-repo)s on [PDS](https://atproto.com/guides/glossary#pds-personal-data-server)es. +# Test-drive a CAR -**Today we're looking at the repo!** Or at least its serialized format. +When apps sync data from your PDS, it comes in a format called a [**C**ontent **A**ddressable a**R**chive](https://ipld.io/specs/transport/car/carv1/#format-description): a CAR file! 🚗 -The repo (repository) is a key-value store of repo-keys to records. The data structure used is called a Merkle Search Tree (MST), but we're not going to worry about that just yet. +This archive can contain your entire "repo" (repository), which is your **[records](https://atproto.com/guides/glossary#record)**, their **keys** (the record's `collection` and `rkey` combined). It also has some additional structural info [for the MST](https://atproto.com/guides/data-repos#data-layout), but we're not going to worry about that just yet! -Wait, "repo keys"?? Remember [yesterday](./2) how an at-uri is made of three parts, `at:////`? The second two parts together, `/`, make up the actual raw keys (repo keys) inside your atproto repository. +## YOU WOULDN'T DOWNLOAD A CAR +…who are we kidding, +Loading (JS required) … -TODO blah blah merkle tree but not getting too distracted because this is about the CAR - -where do CARs come in? - -- nice neat serialization format -- what you get when you export your repo -- what apps get when they sync your repo -- what PDSs send as proof for sync.getRecord -- what gets sent over the firehose - -- header with root cid -- blocks (cid, block) - -- block content is dag-cbor (already covered a bit from day 2) -- there are also MST blocks (also dag-cbor, you can ignore them if you want) - -OH YEAH terminology note: dag-cbor is out, i think we're all drisl now? drisl-cbor? - -- CIDs (ignorable) - -### Your CAR is ready - -Click the button below for your very own CAR export of an atproto repository. Search the CAR for your verification code and submit it below. +Your challenge: **find the `verification_code` hidden inside**. + +
+ Hint: atproto CAR tools (easy-mode) + + There are some nice web tools for poking around in a CAR: + + + + Or, if you have the [goat](https://github.com/bluesky-social/goat?tab=readme-ov-file#goat-go-at-protocol-cli-tool) command-line utility installed, try running: + + + ```bash + goat repo --help + ``` + +
+ +
+ CAR libraries (write some code) + + If you're feeling adventurous, you can write a program to show the contents of a CAR file. Some libraries that can help: + + +
+ +
+ Binary spelunking (bits & bytes) + + Oh, you want hard-mode? Here: + + - [CAR format spec](https://ipld.io/specs/transport/car/carv1/#format-description) + - [MST atproto spec](https://atproto.com/specs/repository#mst-structure) + +
+ Binary hint cheat + + Text inside records is not compressed or weirdly encoded, and CAR just length-prefixes blocks without changing any bytes, so `strings` or even `hexdump -C` on your CAR might be worth trying… +
+ +
-Loading (JS required) …