The fusion of edge computing architecture and blockchain technology faces challenges such as heterogeneous edge device performance limitations and the inefficiency and high storage redundancy of blockchain systems, resulting in suboptimal fusion results. To address these issues, this paper proposes a layered and sharded blockchain storage model tailored for edge computing. The model adopts a master–slave structure for layered blockchain deployment, which means deploying the main chain in the cloud center to integrate the state information of multiple shard subchains, achieving consistency in the state of the master and slave chains, with each shard subchain responsible for storing data. Meanwhile, considering the performance variations and distribution characteristics of edge devices, this paper designs subchains in the edge chain layer by clustering edge devices with similar performance and proximity into the same type of shard using the concept of community discovery, ensuring balanced storage performance among nodes within the shard. On this basis, this paper also proposes a weight-based consistent hashing algorithm that is capable of distributing data to heterogeneous edge devices according to their weights. Simulation experiments demonstrate that the proposed solution offers advantages in terms of high throughput and low storage redundancy.