Andrew Mountbatten Windsor arranged a private tour of Buckingham Palace while the late Queen was in residence, for businessmen from a cryptocurrency mining firm which agreed to pay his ex-wife up to £1.4m, the BBC can reveal.

Jay Bloom and his colleague Michael Evers were driven through the palace gates in the former prince's own car after being collected from their five-star Knightsbridge hotel for the visit in June 2019.

Their company, Pegasus Group Holdings, which Mr Bloom co-founded, employed Sarah Ferguson as a brand ambassador for a crypto-mining scheme which would lose investors millions when it failed less than a year later.

Mr Bloom, an entrepreneur who had previously set up a failed Mafia-themed museum in Las Vegas, and Mr Evers, a former actor, were met by a greeter and escorted inside the palace.

Mr Evers told the BBC they then met the Queen, although Mr Bloom disputed this.

Both Mr Evers and Mr Bloom were invited by the then-prince to his Pitch@Palace event - a Dragons' Den-style business pitching competition - at nearby St James's Palace later that day, and they dined that evening with Andrew, Ms Ferguson and their daughter Princess Beatrice.

Ms Ferguson was working with Pegasus Group Holdings at the time of the palace visit, while she was Duchess of York, to promote plans to use thousands of solar power generators to mine Bitcoin at a remote site in the Arizona desert.

But the project ultimately failed with only 615 of the planned 16,000 generators acquired and just $33,779 (about £25,000) in cryptocurrency mined.

In April 2021, some investors took legal action, claiming millions of dollars of investor funds were unaccounted for. A tribunal awarded the investors $4.1m, but Mr Bloom is seeking permission to appeal.

The revelations add to growing questions about how Andrew and his former wife have funded their lifestyle, as well as long-standing concerns about their business connections and that the then-prince may have used his royal titles and connections for private gain.

On Thursday evening, Buckingham Palace announced that it was starting the formal process of stripping Andrew of his royal titles and that he would be losing his Windsor mansion, following intense criticism of his links with the billionaire paedophile Jeffrey Epstein.

Andrew and Ms Ferguson did not respond to a detailed list of questions about their involvement with Mr Bloom and the crypto-mining venture.

Sarah Ferguson was paid more than £200,000 for her work for the company and a leaked contract reveals she was in line for a separate bonus worth £1.2m.

She also received a stake in the business, which proposed using solar generators to reduce the cost of the energy-intensive computer calculations needed to generate or mine the digital currency Bitcoin.

Her contract stipulated that she required first-class travel, five-star hotels and the services of a professional hairdresser and make-up artist for the maximum of four networking events she would attend on the company's behalf.

It said she did not hold herself out as an expert on the solar industry and therefore accepted no responsibility for industry-related information or commercial assessments used as the basis for her statements promoting the company.

Sarah Ferguson first met the Las Vegas businessman Jay Bloom in May 2018 when she was at a convention in the city to promote one of her children's books.

The pair struck up a friendship and business relationship. Pegasus documents would subsequently describe her role as to engage with the company's clients, investors and strategic relationships as well as involvement with the company's planned philanthropic activities.

For Mr Bloom, it was an introduction to royal circles which would lead to visits to Buckingham Palace and St James's Palace, a tour of Ms Ferguson and Andrew's home, the Royal Lodge in Windsor, and dinners with her and her family in at least four different countries.

Eight years before the duchess signed up to be a brand ambassador for Pegasus, Mr Bloom had hit the Las Vegas headlines, accused of missing payments and deceiving investors in connection with a mob experience exhibition in the city. Mr Bloom denied wrongdoing, fought investors' lawsuits and vowed to repay them.

He now had a new company, Pegasus, and ambitions to build a hotel and casino in Greece.

It was there in July 2018, while considering investing in the company, that Michael Evers, a former actor and reality TV star who had made money from cryptocurrency investments, first met Ms Ferguson.

The hotel and casino did not get built, but Mr Bloom had soon pivoted Pegasus to a new idea, one that was inspired by seeing a mobile solar power generator in use at the Las Vegas motor speedway in early 2019, according to filings in the later legal action brought by investors.

Mr Bloom and his co-founders hit upon a plan to use vast banks of these units to power a crypto-mining operation. The endeavour, the company estimated, would generate millions of dollars a month.

In March 2019, Ms Ferguson had dinner with Mr Bloom in Los Angeles. They had lunch at the Beverly Hills Hotel a few days later as she helped him try to close a deal for Pegasus. One of her daughters stopped by during the meal.

Mr Evers was now working for Pegasus as well as being an investor. He said he and Mr Bloom were regularly in London over the following months as they explored taking Pegasus public on the AIM market - part of the London Stock Exchange for growing companies.

Two months later, Ms Ferguson was one of two celebrity guests - alongside the motivational speaker Tony Robbins, who says he has coached figures such as Serena Williams and Hugh Jackman - at a ground breaking for Pegasus's energy project launch in the Arizona desert.

They were flown in, with Mr Bloom, Mr Evers and others, in two black-and-gold helicopters and posed with gold-coloured spades and construction hats at the remote site of what Pegasus promised would become a multi-billion-dollar off-grid data centre.

With armed guards with AR-15 rifles and pistols standing nearby, Mr Bloom introduced Ms Ferguson at a press conference as a personal friend.

In the short speech that followed, Ms Ferguson praised the company, saying she was so proud to be here and touted the potential philanthropic uses of the technology in Africa.

That October, a month before Andrew's fateful BBC Newsnight interview where he disastrously attempted to explain his connections to Mr Epstein, Ms Ferguson signed a contract agreeing to provide specific services for Pegasus.

For reasons that remain unexplained, the contract itself was with Alphabet Capital, a British company whose owner, Adrian Gleave, ran a number of caravan and holiday parks.

A High Court ruling in London in 2024 has previously revealed that Ms Ferguson received more than £200,000 for her work for Pegasus from Alphabet Capital.

Andrew has also received money from Alphabet, including £60,500 traced to Mr Gleave and his businesses, according to court documents previously reported by the BBC.

Neither Andrew nor Mr Gleave have explained why this money was paid.

A year after investing millions of dollars in the crypto solar scheme, some of its main investors became concerned about progress and began legal proceedings.

In 2023, judges from the Commercial Arbitration Tribunal in the US found in the investors' favour awarding them millions of dollars.

Jay Bloom has since mounted a number of legal challenges over the award in the Nevada courts.

Mr Bloom told BBC News that Pegasus emphatically disputed any allegations of misconduct and said they were addressing the clearly flawed arbitral findings through established legal processes.

Andrew and Ms Ferguson did not respond to the BBC's questions, including whether Ms Ferguson planned to repay money received for her Pegasus work to the company's investors.

Mr Evers said he regretted being involved with Pegasus. He said Mr Bloom was working very, very hard to get all the investors paid back but that he was frustrated to still be owed money himself several years later.