Blockchain can be of two types - 1) Public and 2) Private
1. Public blockchain
A public blockchain is a sort of blockchain in which all nodes on the network may see all transactions. Anyone can join the network without any permission.
For example, the Bitcoin blockchain is public. You can see all the transactions in this block explorer.
Ethereum is one of the most popular public blockchain protocols you can use to write smart contracts.
2. Private blockchain
What if you don't want to reveal your company secrets/there is something you can't publish publicly and want to limit access to your network to select trusted people? You can accomplish this by using a private blockchain. Only the nodes in a network can see private blockchain transactions.
One of the most popular private blockchain protocols for writing smart contracts is Hyperledger Fabric.