He shares music and lyric credits with Max Martin and Karl Johan Schuster.
Miranda will be joined by Auli'i Cravalho, who voiced the lead character in Moana, and the two will perform Miranda's Oscar-nominated song from the film, titled "How Far I'll Go".
Legend, who starred in La La Land, will perform both Audition (The Fools Who Dream) and City of Stars.
When it comes to the performers for the Best Original Song at each year's Academy Awards, its usually a bit of a mixed bag.
Though Legend does not perform the nominated songs in "La La Land", he does have a supporting role in the film.
The tracks were written by Justin Hurwitz, Benj Pasek and Justin Paul.
Justin Timberlake will be on hand to sing Can't Stop The Feeling from the animated movie Trolls, while Sting will perform his track The Empty Chair from the documentary Jim: The James Foley Story.
John Legend performs "Glory" from "Selma" onstage during the 87th Annual Academy Awards in February 2015.
Show producers Michael De Luca and Jennifer Todd said: 'We're thrilled to welcome these world-class artists to the Oscars. Sting co-wrote the song with J. Ralph. "The Weeknd performed "Earned It" from Fifty Shades of Grey, Lady Gaga delivered a powerful performance of "'Til It Happens to You" from The Hunting Ground and Sam Smith performed "Writing's On the Wall" from Spectre, which won the category.
The show is set to take place at the Dolby Digital Theater and it will air live on ABC on Sunday at 7 p.m. ET / 4 p.m. PT. Jimmy Kimmel has been announced to host the show and if it is going to be anything like the last year's Emmy awards, it will be a treat to watch.