In Hyperledger Fabric, chaincode acts as the smart contract that defines the business logic agreed upon by the participating parties in a blockchain network. Chaincode is responsible for defining the rules governing transactions, such as how assets are created, updated, and transferred among network members. It is executed on the nodes of the network to validate transactions and update the ledger accordingly. Chaincode is written in programming languages such as Go, Java, or Node.js and is invoked by network members to interact with the blockchain network.