Practical Byzantine Fault Tolerance (PBFT) is a deterministic consensus algorithm, which is widely used in blockchain due to the advantage of no forks. However, PBFT still has some problems, such as not being suitable for dynamic networks, requiring large communication overhead, and not being able to identify Byzantine nodes. Therefore, we propose Extensible-PBFT (EPBFT) consensus algorithm, it can take different steps to reach consensus according to the network environment of the system. Firstly, we add the election of consensus nodes based on verifiable random function (VRF), which makes EPBFT suitable for dynamic networks. Then, we modify the consistency protocol so that EPBFT can reach consensus with less communication in a stable network, and it can also identify Byzantine nodes and reduce confirmation latency. Finally, we simplify the checkpoint protocol and the view-change protocol, reducing the time and communication overhead they require.