Authentication is the first entrance to kinds of information systems; however, traditional centered single-side authentication is weak and fragile, which has security risk of single-side failure or breakdown caused by outside attacks or internal cheating. In the edge and IoT environment， blockchain can apply edge devices to better serve the Internet of Things and provide decentralized high security service solutions. In this paper, we proposed a blockchain-based decentralized authentication modeling scheme (named BlockAuth) in edge and IoT environment to provide a more secure, reliable and strong fault tolerance novel solution, in which each edge device is regarded as a node to form a blockchain network. We designed secure registration and authentication strategy, blockchain-based decentralized authentication protocol, and developed the blockchain consensus, smart contract, and implemented a whole blockchain-based authentication platform for the feasibility, security and performance evaluation. The analysis and evaluation show that the proposed BlockAuth scheme provides a more secure, reliable and strong fault tolerance decentralized novel authentication with high-level security driven configuration management. The proposed BlockAuth scheme is suitable for password-based, certificate-based, biotechnology-based, and token-based authentication for high level security requirement system in Edge and IoT Environment.