Increasingly, blockchain technology is attracting significant attentions in various agricultural applications. These applications could satisfy the diverse needs in the ecosystem of agricultural products, e.g., increasing transparency of food safety and IoT based food quality control, provenance traceability, improvement of contract exchanges, and transactions efficiency. As multiple untrusted parties, including small-scale farmers, food processors, logistic companies, distributors and retailers, are involved into the complex farm-to-fork pipeline, it becomes vital to achieve optimal trade-off between efficiency and integrity of the agricultural management systems as required in contexts. In this paper, we provide a survey to study both techniques and applications of blockchain technology used in the agricultural sector. First, the technical elements, including data structure, cryptographic methods, and consensus mechanisms are explained in detail. Secondly, the existing agricultural blockchain applications are categorized and reviewed to demonstrate the use of the blockchain techniques. In addition, the popular platforms and smart contract are provided to show how practitioners use them to develop these agricultural applications. Thirdly, we identify the key challenges in many prospective agricultural systems, and discuss the efforts and potential solutions to tackle these problems. Further, we conduct an improved food supply chain in the post COVID-19 pandemic economy as an illustration to demonstrate an effective use of blockchain technology. INDEX TERMS Blockchain technology, agricultural applications, food supply chains management, data integrity, traceability.