ArticleslgStudy

science

BagIt

BagIt is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand BagIt rather than just read about it. In short: BagIt is a set of hierarchical file system conventions designed to support disk-based storage and network transfer of arbitrary digital content. A "bag" consists of a "payload" (the arbitrary content) and "tags," which are metadata files intended to document the storage and transfer of the bag.

Key takeaways

  • BagIt belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect BagIt to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of BagIt from memory before moving on to harder problems.

Reference excerpt

BagIt is a set of hierarchical file system conventions designed to support disk-based storage and network transfer of arbitrary digital content. A "bag" consists of a "payload" (the arbitrary content) and "tags," which are metadata files intended to document the storage and transfer of the bag. A required tag file contains a manifest listing every file in the payload together with its corresponding checksum. The name, BagIt, is inspired by the "enclose and deposit" method, sometimes referred to as "bag it and tag it." Bags are ideal for digital content normally kept as a collection of files. They are also well-suited to the export, for archival purposes, of content normally kept in database structures that receiving parties are unlikely to support. Relying on cross-platform (Windows and Unix) filesystem naming conventions, a bag's payload may include any number of directories and sub-directories (folders and sub-folders). A bag can specify payload content indirectly via a "fetch.txt" file that lists URLs for content that can be fetched over the network to complete the bag; simple parallelization (e.g. running 10 instances of Wget) can exploit this feature to transfer large bags very quickly. Benefits of bags include:

Wide adoption in digital libraries (e.g. the Library of Congress). Easy to implement using ubiquitous and ordinary filesystem tools. Content that originates as files need only be copied to the payload directory. Compared to XML wrapping, content need not be encoded (e.g. Base64), which saves time and storage space. Received content is ready-to-go in a familiar filesystem tree. Easy to implement fast network transfer by running ordinary transfer tools in parallel.

Specification BagIt is currently defined in RFC 8493. It defines a simple file naming convention used by the digital curation community for packaging up arbitrary digital content, so that it can be reliably transported via both physical media (hard disk drive, CD-ROM, DVD) and network transfers (FTP, HTTP, rsync, etc.). BagIt is also used for managing the digital preservation of content over time. Discussion about the specification and its future directions takes place on the Digital Curation discussion list. The BagIt specification is organized around the notion of a "bag." A bag is a named file system directory that minimally contains:

a data directory that includes the payload, or data files that comprise the digital content being preserved. Files can also be placed in subdirectories, but empty directories are not supported. at least one manifest file that itemizes the filenames present in the data directory, as well as their checksums. The particular checksum algorithm is included as part of the manifest filename. For instance, a manifest file with MD5 checksums is named manifest-md5.txt. a bagit.txt file that identifies the directory as a bag, the version of the BagIt specification that it adheres to, and the character encoding used for tag files. On receipt of a bag, a piece of software can examine the manifest file to make sure that the payload files are present and that their checksums are correct. This allows for accidentally removed or corrupted files to be identified. Below is an example of a minimal bag, example-bag, that encloses two payload files. The contents of the tag and metadata files are included below their filenames.

example-bag/ ├── bagit.txt BagIt-Version: 1.0 Tag-File-Character-Encoding: UTF-8 ├── data │ ├── test.png │ └── test.txt └── manifest-md5.txt 0057094f809ad31a0ab4bbb714b5723e data/test.png 2d51cb9ed6b7b9f2896f514252590e0e data/test.txt

In this example the payload happens to consist of a PNG image file and a text file. The identification and definition of file formats is out of the scope of the BagIt specification; file attributes are likewise out of scope. The specification allows for several optional tag files (in addition to the manifest). Their character encoding must be identified in bagit.txt, which itself must always be encoded in UTF-8. The specification defines the following optional tag files:

a bag-info.txt file which details metadata for the bag, using colon-separated key/value pairs (similar to HTTP headers) a tag manifest file which lists tag files and their associated checksums (e.g. tagmanifest-md5.txt) a fetch.txt that lists URLs where payload files can be retrieved from in addition or to replace payload files in the data directory The optional tag manifest and bag-info files for the example bag would be the following:

├── bag-info.txt Bagging-Date: 2026-11-04 Bag-Software-Agent: bagr v0.3.0 <https://github.com/pwinckles/bagr> Payload-Oxum: 136543.2 └── tagmanifest-md5.txt 907ece0fccb8b968ed5064c1fa06b3b6 bag-info.txt eaa2c609ff6371712f623f5531945b44 bagit.txt 6cbf4a6910e4f9349bbb26e6fecef573 manifest-md5.txt

Until version 15, the draft also described how to serialize a bag in an archive file, such as ZIP or TAR. From version 15 on, the serialization is no longer part of the specifications, not because of technical reasons but because of the scope and focus of the specification.

History The BagIt specification emerged from a collaboration between the Library of Congress and the California Digital Library while transferring digital content created as part of the National Digital Information Infrastructure and Preservation Program. The origins of the idea date back to work done at the University of Tsukuba on the "enclose and deposit" model, for mutually depositing archived resources to enable long-term digital preservation. The practice of using manifests and checksums is fairly common practice as evidenced by their use in ZIP (file format), the Deb (file format), as well as on public FTP sites. In 2007, the California Digital Library needed to transfer several terabytes of content (largely Web archiving data) to the Library of Congress. The BagIt specification allowed the content to be packaged up in "bags" with package metadata and a manifest that detailed file checksums, which were later verified on receipt of the bags. The specification was written up as an IETF draft by John Kunze in December 2008, where it has seen several revisions before being issued as an RFC. In 2009, the Library of Congress produced a video that describes the specification and the use cases around it. In 2018, version 1.0 was published as an RFC by the Internet Engineering Task Force.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with BagIt

Start with the simplest possible case. Write down what BagIt claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to BagIt before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about BagIt ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of BagIt

In research
BagIt appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses BagIt in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
BagIt is common in secondary-school and first-year university syllabi. It links to neighbouring topics Archival science, Archive formats, Digital preservation, so understanding it makes those chapters shorter.
In everyday life
Look for BagIt outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “BagIt” →

How to study BagIt in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what BagIt means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain BagIt out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is BagIt in simple terms?

BagIt is a set of hierarchical file system conventions designed to support disk-based storage and network transfer of arbitrary digital content. A "bag" consists of a "payload" (the arbitrary content) and "tags," which are metadata files intended to document the storage and transfer of the bag.

Why does BagIt matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study BagIt?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on BagIt.

Tags

  • Archival science
  • Archive formats
  • Digital preservation

Keep exploring