How much did it 'cost' slave-owning nations to emancipate the slaves as a percentage of GDP? According to this article in the Guardian the UK Treasury tweeted in 2018:


  "Did you know that in 1833, Britain used £20 million pounds - which amounted to 40% of the UK GDP to buy freedom for all slaves in the Empire. The amount of money borrowed for the Slavery Abolition Act was so large that it wasn't paid off until 2015. This means that every living British citizen paid for ending the slave trade."


To which one angry British citizen, Lexington Wright, tweeted back:


  "So basically my father, and his children and grand-children have been paying taxes to compensate those who enslaved our ancestors and you want me to be proud of this fact? Are you f****** insane???"


The Guardian adds as commentary to this exchange:


  Few people in the 1830s would have seen it this way. Compensation was a mechanism of ending a system that millions of people had come to regard as abhorrent and a national disgrace. The abolitionists agonised over it ... the only people who saw a positive in it were the people who spent three decades campaigning for it and would be the beneficiaries of it - the slave owners.


They go on to add:


  The slave owners not only recieved compensation from the British Taxpayer they won another concession, the euphemistically named 'apprenticeship' system. What this meant was that slaves were forced to work on the fields for another further six years without pay after the abolition of slavery.


The above is the background to the following questions:

Q. The compensation was paid for emancipating slaves in the Empire. How much of this was paid for the top five slave-owning nations? Who are they, and how many slaves were emancipated?

**Q. How much was this worth as a percentage of the top slave-owning nations GDP at that time? And in particular, the USA?

Q. Was any additional monies paid by any of those nations governments as compensation?

Q. How did they come up with the figure of £20 million pounds - was this solely based on the market values of slaves at the time or were other factors taken into consideration?

Q. How would one cost the six years of unpaid work by emancipated slaves and how much did this come to? 

There are a number of questions but they are all interlinked and prompted by the initial tweet. I can ask them separately if people wish.
Unfortunately, I'm not sure this will really answer the questions you raised to your satisfaction, but I can at least give some of them a try:

First Note: It wasn't 40% of the GDP of the Empire, but rather the 20 million GBP sum was equivalent to 40% of their annual governmental expenditures (or 5% of the Empire's contemporary GDP) source here.

Regarding your first couple of questions: unfortunately, there's no good, useful answer that I can find. If you were interested in calculating these numbers yourself, it might be worthwhile to look at this online database of payments made under the act. That said, it's important to remember that, as colonies of the British Empire, there might well be many reasons that could make the desired "contemporary GDP amount" difficult to calculate. For example, if there's an individual who owned plantations in Trinidad and the Bahamas, they themselves might live in London. Thus, for all practical matters, the compensation payment the plantation owner would receive doesn't flow to either colony, and shouldn't be considered in those colonies GDPs.

As for "how did they come up with 20 million GBPs?" While I haven't seen a specific answer, I'd imagine much the same way compensation pools are created today- by Parliamentary negotiation, estimation and extrapolation. The number itself is known exactly (that is, we know it's 20 million, and that's not an estimation on the part of the Guardian) since it's inscribed in paragraph XXIV of the act itself (have to scroll down a bit, or search on the page for "million"). That said, there's specific information in paragraph XLV of that act how the sum of 20 million GBP should be divvied up between the different colonies, and that's based on the local "value" of slaves in each colony for the previous eight years.

About additional compensation- no. Remember, there weren't really those "national governments" at the time. They all were, by definition of the act, only territories which were still completely ruled by the British crown. As far as I know, no regional governors supplemented that pool (I'm not even sure if they would have been allowed to, since the authorization for the payments in this case were from the British Parliament, and the vehicle to disperse the payments was a commission set up by the act).

Finally, I'm not exactly sure what you mean by "how would you cost the six years of unpaid labor." Who are you referring to "costing" this? The value of this labor wasn't included in the payments by Parliament. If you were thinking about what the effective cost of this provision was (that is, how much it cost the slaves whose freedom was delayed by those six years) then again, I think it might be an open question.

Again, I'll check back later to see if I can help by refining my answer. Let me know how this aligns with what you were looking for. Also, these additional resources might provide a bit of useful info!
NB: the total number of slaves freed uner this act is roughly 800,000