Biofilms are communities of microbial cells that are encapsulated within a self-produced polymeric matrix. The matrix is critical to the success of biofilms in diverse habitats, but despite this many details of the composition, structure, and function remain enigmatic. Biofilms formed by the Gram-positive bacterium Bacillus subtilis depend on the production of the secreted film-forming protein BslA. Here we show that a gradient of electron acceptor availability through the depth of the biofilm gives rise to two distinct functional roles for BslA and that these can be genetically separated through targeted amino acid substitutions. We establish that monomeric BslA is necessary and sufficient to give rise to complex biofilm architecture, whil...