Continuing with the story:
"18 And Cain loved Satan more than God. And Satan commanded him, saying: Make an offering unto the Lord.
19 And in process of time it came to pass that Cain brought of the fruit of the ground an offering unto the Lord.
20 And Abel, he also brought of the firstlings of his flock, and of the fat thereof. And the Lord had respect unto Abel, and to his offering;
21 But unto Cain, and to his offering, he had not respect. Now Satan knew this, and it pleased him. And Cain was very wroth, and his countenance fell.
22 And the Lord said unto Cain: Why art thou wroth? Why is thy countenance fallen?
23 If thou doest well, thou shalt be accepted. And if thou doest not well, sin lieth at the door, and Satan desireth to have thee; and except thou shalt hearken unto my commandments, I will deliver thee up, and it shall be unto thee according to his desire. And thou shalt rule over him;
24 For from this time forth thou shalt be the father of his lies; thou shalt be called Perdition; for thou wast also before the world.
25 And it shall be said in time to come—That these abominations were had from Cain; for he rejected the greater counsel which was had from God; and this is a cursing which I will put upon thee, except thou repent.
26 And Cain was wroth, and listened not any more to the voice of the Lord, neither to Abel, his brother, who walked in holiness before the Lord.
27 And Adam and his wife mourned before the Lord, because of Cain and his brethren." (Moses 5:18-27).
The commandment and covenant Adam and Eve and their children had received was to offer up animal sacrifices in the similitude of the sacrifice of the Only Begotten of God. It was a blood sacrifice in expectation of the Atonement of the Son of God. Abel offered up a blood sacrifice, Cain did not. Cain listened to Satan and tried to offer up the fruit of the ground - whatever he farmed - instead of offering up an animal sacrifice. He offered a sacrifice but not the sacrifice the Lord required; Cain offered up the sacrifice Satan wanted him to. Satan knew the sacrifice would be rejected. Satan knew how Cain would react - he knew he would be upset and curse God. He was and he did.
Then Cain started off the deep end - he made a pact with Satan; it was a pact of secrets and murder for gain. "And it came to pass that Cain took one of his brothers’ daughters to wife, and they loved Satan more than God. And Satan said unto Cain: Swear unto me by thy throat, and if thou tell it thou shalt die; and swear thy brethren by their heads, and by the living God, that they tell it not; for if they tell it, they shall surely die; and this that thy father may not know it; and this day I will deliver thy brother Abel into thine hands. And Satan sware unto Cain that he would do according to his commands. And all these things were done in secret. And Cain said: Truly I am Mahan, the master of this great secret, that I may murder and get gain. Wherefore Cain was called Master Mahan, and he gloried in his wickedness." (Moses 5:28-31).
Cain dealt with Satan in secrecy. Cain became Perdition - a destroyer (Latin: perdere - to destroy) of truth; one who gave away his covenants for new ones with the devil. Cain was promised that he would rule over Satan - Cain had at least kept his first estate whereas Lucifer did not. From God Cain received the title Perdition, from himself (and possibly from Satan) he received the title of Mahan, which is of unclear meaning but based on context probably means something close to "master [owner, holder, keeper] of [a] secret." (This interpretation agrees with what Hugh Nibley believed the title meant. See Hugh Nibley, Ancient Documents and the Pearl of Great Price, p.12. In this document Dr. Nibley suggests that the word Master is not the English word master, but derives from Arabic word Mustirr ("keeper of secret") and Mahan is related to the Sanskrit word maha ("great"); source). Cain's covenant with Satan included a penalty of death for those who revealed it (this was a covenant that Cain's friends, some of his brothers and sisters and their families, made too). Satan promised to deliver Abel into the hands of Cain. Cain would also reap the riches of his brother - his flocks.