One or more embodiments of this specification provide methods and apparatuses for transmitting messages. A method includes: registering, based on a registration request sent by each blockchain node in a blockchain relay communication network, a blockchain node to a blockchain node set indicated by the registration request; determining, in response to receiving a blockchain message to be sent to a target blockchain node set, a target blockchain node registered to the target blockchain node set and a target relay node in the blockchain relay communication network; and transmitting the blockchain message to the target blockchain node through the target relay node.