Can securities be settled on a blockchain and, if so, what are the gains relative to existing settlement systems? We consider a blockchain that ensures delivery versus payment by linking transfers of assets with payments and operates using a proof-of-work protocol. The main benefit of a blockchain is faster and more flexible settlement, whereas the challenge is to avoid settlement fails when participants fork the chain to get rid of trading losses. To deter forking, the blockchain needs to restrict settlement speed through block size and block time to generate sufficient transaction fees, which finance costly mining. We show that large enough trading volume, sufficiently strong preferences for fast settlement and limited trade size and risk are necessary conditions for blockchain-based settlement to be feasible. Despite mining being a deadweight cost, our estimates based on the market for US corporate debt show that gains from moving to faster and more flexible settlement are in the range of 1 to 4 basis points relative to existing legacy settlement systems.