Parshas Vayayshev: Who Sold Yosef?
Based on Rav Shmuel Golden's book Unlocking the Torah Text Bereishit pg 210

(כד) וַיִּ֨קָּחֻ֔הוּ וַיַּשְׁלִ֥כוּ אֹת֖וֹ הַבֹּ֑רָה וְהַבּ֣וֹר רֵ֔ק אֵ֥ין בּ֖וֹ מָֽיִם׃ (כה) וַיֵּשְׁבוּ֮ לֶֽאֱכָל־לֶחֶם֒ וַיִּשְׂא֤וּ עֵֽינֵיהֶם֙ וַיִּרְא֔וּ וְהִנֵּה֙ אֹרְחַ֣ת יִשְׁמְעֵאלִ֔ים בָּאָ֖ה מִגִּלְעָ֑ד וּגְמַלֵּיהֶ֣ם נֹֽשְׂאִ֗ים נְכֹאת֙ וּצְרִ֣י וָלֹ֔ט הוֹלְכִ֖ים לְהוֹרִ֥יד מִצְרָֽיְמָה׃ (כו) וַיֹּ֥אמֶר יְהוּדָ֖ה אֶל־אֶחָ֑יו מַה־בֶּ֗צַע כִּ֤י נַהֲרֹג֙ אֶת־אָחִ֔ינוּ וְכִסִּ֖ינוּ אֶת־דָּמֽוֹ׃ (כז) לְכ֞וּ וְנִמְכְּרֶ֣נּוּ לַיִּשְׁמְעֵאלִ֗ים וְיָדֵ֙נוּ֙ אַל־תְּהִי־ב֔וֹ כִּֽי־אָחִ֥ינוּ בְשָׂרֵ֖נוּ ה֑וּא וַֽיִּשְׁמְע֖וּ אֶחָֽיו׃

(24) and took him and cast him into the pit. The pit was empty; there was no water in it. (25) Then they sat down to a meal. Looking up, they saw a caravan of Ishmaelites coming from Gilead, their camels bearing gum, balm, and ladanum to be taken to Egypt. (26) Then Judah said to his brothers, “What do we gain by killing our brother and covering up his blood? (27) Come, let us sell him to the Ishmaelites, but let us not do away with him ourselves. After all, he is our brother, our own flesh.” His brothers agreed.

(כח) וַיַּֽעַבְרוּ֩ אֲנָשִׁ֨ים מִדְיָנִ֜ים סֹֽחֲרִ֗ים וַֽיִּמְשְׁכוּ֙ וַיַּֽעֲל֤וּ אֶת־יוֹסֵף֙ מִן־הַבּ֔וֹר וַיִּמְכְּר֧וּ אֶת־יוֹסֵ֛ף לַיִּשְׁמְעֵאלִ֖ים בְּעֶשְׂרִ֣ים כָּ֑סֶף וַיָּבִ֥יאוּ אֶת־יוֹסֵ֖ף מִצְרָֽיְמָה׃

(28) When Midianite traders passed by, they pulled Joseph up out of the pit. They sold Joseph for twenty pieces of silver to the Ishmaelites, who brought Joseph to Egypt.

(לו) וְהַ֨מְּדָנִ֔ים מָכְר֥וּ אֹת֖וֹ אֶל־מִצְרָ֑יִם לְפֽוֹטִיפַר֙ סְרִ֣יס פַּרְעֹ֔ה שַׂ֖ר הַטַּבָּחִֽים׃ (פ)

(36) The Midianites, meanwhile, sold him in Egypt to Potiphar, a courtier of Pharaoh and his chief steward.

(א) וְיוֹסֵ֖ף הוּרַ֣ד מִצְרָ֑יְמָה וַיִּקְנֵ֡הוּ פּוֹטִיפַר֩ סְרִ֨יס פַּרְעֹ֜ה שַׂ֤ר הַטַּבָּחִים֙ אִ֣ישׁ מִצְרִ֔י מִיַּד֙ הַיִּשְׁמְעֵאלִ֔ים אֲשֶׁ֥ר הוֹרִדֻ֖הוּ שָֽׁמָּה׃

(1) When Joseph was taken down to Egypt, a certain Egyptian, Potiphar, a courtier of Pharaoh and his chief steward, bought him from the Ishmaelites who had brought him there.
(ב) וימשכו בְנֵי יַעֲקֹב אֶת יוֹסֵף מִן הַבּוֹר וַיִּמְכְּרוּהוּ לַיִּשְׁמְעֵאלִים, וְיִּשְׁמְעֵאלִים לַמִּדְיָנִים, וְהַמִּדְיָנִים לַמִצְרִים:
(2) וימשכו AND THEY DREW UP — the sons of Jacob drew up את יוסף מן הבור JOSEPH FROM THE PIT, and they sold him to the Ishmaelites, and the Ishmaelites to the Midianites and the Midianites into Egypt (Midrash Tanchuma 1:9:13).

(א) מדינים סוחרים בעלי סחורת גמלי הישמעאלים: (ב) וימכרו את יוסף לישמעאלים לישמעאלים עשו את המכר בעד המדינים הסוחרים ולא רצו לדבר עם הסוחרים פן יכירום בשבתם לפעמי' בעירות למכור אבל דברו עם בעלי הגמלים שאינם מתעכבים בעירות אבל עוברים בהם דרך העבר' בלכד ועל ידם עשו המכר אבל הקונים היו המדינים סוחרים כאמרו והמדנים מכרו אותו אל מצרים. וכן קרה לאבותינו בכית שני שמכרו קצתם את קצתם ביד הרומיים בפרט כשצרו מלכי בית חשמונאי זה על זה כמו שהיה הענין במכירת יוסף שנתגלגל הדבר וירדו אבותינו למצרי' בדבריה' ז''ל:

(1) מדינים סוחרים, the owners of the merchandise being transported on the Ishmaelites’ camels. (2) וימכרו את יוסף לישמעאלים, they completed the deal with the Ishmaelites acting as agents for the Midianites. The brothers did not want to speak to the Midianite merchants. The reason was that they did not want to be recognised by them as they were in the habit of frequenting cities in order to ply their wares. The camel drovers, however, were not in the habit of visiting urban areas. At worst they would just pass through towns without stopping there overnight or longer. The actual purchasers, however, were the Midianite merchants, in accordance with the Torah’s narrative that the Midianites sold Joseph to Egypt (verse 36). The Jewish people experienced something parallel during the period of the second Temple, when Midianites sold a portion of our people into slavery to surrounding nations, a phenomenon which was widespread during the time when the descendants of the Hasmoneans were fighting among themselves about who would be king in Jerusalem. This fratricide is responsible for our exile until this day. It was a historical replay of what happened as a result of the brothers selling Joseph, and the whole family winding up in exile in Egypt only a few years later. Compare what our sages have to say on the subject in Shabbat 10.

(א) והנה ארחת ישמעאלים באה מגלעד כאשר נשאו עיניהם וראו מרחוק אנשים באים מדרך גלעד הכירו כי ארחת ישמעאלים היא בגמלים וידעו כי למצרים ילכו כי מגלעד יובא הצרי והנכאת ולמצרים היה דרכם להוליך אותו ולכן אמר להם יהודה הנה האנשים האלה מארץ מרחק והולכים אל ארץ רחוקה נמכרנו להם כי לא יודע הדבר וכאשר קרבו להם מצאו כי היו בעלי סחורה אשר להם הנכאת והצרי אנשים מדינים סוחרים ששכרו הגמלים מהישמעאלים וימכרו את יוסף למדינים שקנו אותו לסחור בו לסחורה כי ארחת הישמעאלים משכירי הגמלים לא יקנו הם סחורה לעצמם ואמר (בפסוק כח) וימכרו את יוסף לישמעאלים כי להם מסרו אותו שהם מוליכים הסחורה למצרים וזה טעם מיד הישמעאלים אשר הורידוהו שמה (להלן לט א) כי היה בידם אבל המדינים היו בעליו והם סחרו בו והוא שאמר והמדנים מכרו אותו אל מצרים וכל מעשה בכתוב פעם יספר אותו במושל המצוה בו ופעם בשליח שיעשנו בידו

(1) ..When they raised their eyes and saw from afar men coming from the road from Gilad, they recognized that they were an Ishmealite caravan on the camels and they knew that they were going to Egypt, since from Gilad comes <name of="" road="" #1=""> and <name of="" road="" #2="">, and this was the way people went to Egypt. <loose translation=""> Therefore, Yehuda said to them, 'These men are from a far land and going to a far land. We will sell him to them and the matter will not become known.' When they came closer, they found that they were merchants who travel those roads, Midianite merchants who leased the camels from the Ishmealites and they sold Yosef to the Midianites, who bought him in order to trade him, for the Ishmealites, the lessors of the camels, did not purchase merchandise for themselves. It says in 37:28, "They sold Yosef to the Ishmealites" because they gave him to them while they were carrying the merchandise to Egypt , and that is the meaning of the phrase "from the Ishmealites who brought him down there," because he had been in their hands (=in their custody) even though the Midianites were his owners and they traded him, like it says in 37:36, "The Midianites sold him to Egypt," for any action in the Chumash will once be told with [the name of] the one who commanded it and once will be told with [the name of] the one who carried it out.

(א) ויעברו אנשים מדינים - ובתוך שהיו יושבים לאכול לחם ורחוקים היו קצת מן הבור לבלתי אכול על הדם וממתינים היו לישמעאלים שראו וקודם שבאו הישמעאלים עברו אנשים מדינים אחרים דרך שם וראוהו בבור ומשכוהו ומכרוהו המדיינים לישמעאלים. ויש לומר: שהאחים לא ידעו ואף על פי שכתוב אשר מכרתם אותי מצרימה. יש לומר: שהגרמת מעשיהם סייעה במכירתו. זה נראה לי לפי עומק דרך פשוטו של מקרא. כי ויעברו אנשים מדינים משמע ע"י מקרה והם מכרוהו לישמעאלים. ואף אם באתה לומר וימכרו את יוסף לישמעאלים כי אחיו מכרוהו, אם כן צריך לומר שהם ציוו למדינים סוחרים למושכו מן הבור, ואח"כ מכרוהו לישמעאלים.
(1) ויעברו אנשים מדינים, while the brothers had been sitting down to consume their meal, having distanced themselves somewhat from the pit into which they had thrown Joseph in order not to be guilty of “eating while spilling blood,” they were waiting for the Ishmaelites whom they had seen in the distance, to arrive. During this period the Midianites, coming from a different direction had passed there, saw Joseph in the pit, pulled him up, and proceeded to sell him to the Ishmaelites. One may assume that the brothers had no knowledge of this. Even though the Torah appears to attribute the sale of Joseph to the Ishmaelites to the brothers, (based on Joseph accusing them of having sold him to Egypt, 45,4) we would have to say that because of their having been instrumental in bringing about that sale they are considered as if having assisted in that sale. This appears to me the deeper meaning of the plain meaning of the text both here and in chapter 45. The line describing the Midianites passing that way is described as something totally coincidental, having nothing to do with what the brothers had planned to do with Joseph. Even if the Torah says:וימכרו (את) יוסף לישמעאלים, this sounds as if the brothers did the selling. It is also possible that the brothers noting the Midianites suddenly materialising out of nowhere, instructed them to pull Joseph out of the pit after which they themselves sold him to the Ishmaelites.
(טז) לֹא־תֵלֵ֤ךְ רָכִיל֙ בְּעַמֶּ֔יךָ לֹ֥א תַעֲמֹ֖ד עַל־דַּ֣ם רֵעֶ֑ךָ אֲנִ֖י ה'
(16) Do not deal basely with your countrymen. Do not profit by the blood of your fellow: I am the LORD.

גמ׳ מניין לרואה את חבירו שהוא טובע בנהר או חיה גוררתו או לסטין באין עליו שהוא חייב להצילו ת"ל לא תעמוד על דם רעך.

GEMARA: From where is it derived that one who sees another drowning in a river, or being dragged away by a wild animal, or being attacked by bandits [listin], is obligated to save him? The Torah states: “You shall not stand idly by the blood of another.”