i have been going through documentation of substrate . i came through the point of select chain method for forking concept and find out that their are two methods for chain selection Ghost and longest chain selection. i have found that ghost protocol is more secure than longest chain protocol. when going through code base of substrate i have found that it uses longest chain selection method . can some please provide me brief about it why substrate use longest chain method instead of ghost protocol .

1 Answer 1


Substrate can be used to implement any custom fork rule. The repo mainly provides an implementation for LongestChain and GRANDPA (Ghost-based). I believe LongestChain is mainly used to provide a simple, easy to follow basis for further development. In serious production environments for Substrate-based blockchains, you'd usually see GRANDPA being used rather than the simple longest chain rule.

  • i know it can be implemented can you please tell how to implement it. Commented Feb 14 at 5:04
  • The original question was on "why", if you want to learn "how", you can check out the implementation on mock: github.com/paritytech/polkadot-sdk/blob/…. There's also lots of parachains that use this: github.com/… Basically, the steps are to include GRANDPA in your runtime and configure the chain spec. Note that your validators also need to generate their keys and pass that in as a flag.
    – philoniare
    Commented Feb 21 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.