trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

feat:Add Solana support

Open jcoffland opened this issue 3 years ago • 27 comments

This adds Solana support. I copied the Lisk implementation for much of this. The added Solana API supports signing Solana transaction hashes because there is no practical way to interpret the meaning of Solana transactions on Trezor. Solana transactions consists of one or more calls to contracts plus opaque data to be sent to those contracts. The contracts could do anything so the user must trust the contracts. The user's best chance of verifying that they are signing the intended transaction is by verifying the transaction hash. So this implementation displays the transaction hash to the user for verification.

Solana uses ed25519. It is currently 19 on coinmarketcap. https://coinmarketcap.com/currencies/solana/ There is a web wallet for Solana at https://www.sollet.io/.

See also this Solana issue to add support for Trezor to Solana's command line tools: solana-labs/solana#4911

jcoffland avatar Mar 07 '21 01:03 jcoffland

You can't just sign blindly transaction hash on the device. You need to show transaction contents on the display, then compute the transaction hash in the device and sign this. Otherwise you are defeating the whole purpose of having a hardware wallet.

prusnak avatar Mar 07 '21 10:03 prusnak

@prusnak How can you show the contents of a transaction when it could contain arbitrary data and functionality? Solana can run arbitrary programs. It doesn't have just a few types of transactions.

Besides, if the computer you use to create transactions is compromised, then you cannot guarantee even a send to address that it shows you is correct. Which as you said, defeats the whole purpose of a hardware wallet. So really hardware wallets aren't 100% secure in the first place.

If you can assume an address you want to send coin to is the right address, then it's no worse to assume that a transaction hash matches what you would like to execute.

jcoffland avatar Mar 07 '21 10:03 jcoffland

If you can assume an address you want to send coin to is the right address, then it's no worse to assume that a transaction hash matches what you would like to execute.

You can verify the address and transaction amount via other channel - phone call, email, IM, etc. With transaction hash - not so much.

prusnak avatar Mar 07 '21 10:03 prusnak

I've thought about this a bit more. I think verifying the hash via another channel is the best option but it may be possible to construct part of the transaction on the Trezor. I don't like the idea of signing a transaction that has arbitrary access to your entire balance. Solana has some "built-in" programs (aka contracts) that perform basic functionality such as transferring balances. I believe most Solana transactions begin by transferring an amount of currency or token to a new account. Then they pass this account as a parameter to the target program. This preliminary part of the transaction could be constructed for native SOL transfers and compliant token transfers. I need to do more research.

FYI, from my brief perusal of the Ledger wallet implementation for Solana, it just sends the transaction body to the Ledger hardware for signature. I'm not sure if it attempts to interpret the transaction or not. If the hardware is unable to interpret the transaction then you might as well just send the hash. It's possible you could interpret the parts of the transaction that use Solana built-in programs.

For reference a Solana transaction looks like this:

Solana Transaction
signatures compact-array
- signature u8[64] ed25519
- ...
message
- message header
-- num_signatures u8
-- num_read_only u8
-- num_ro_no_sig u8
- addresses compact-array
-- address u8[32]
-- ...
- blockhash u8[32] sha256
- instructions compact-array
-- program_id_index u8 index in addresses
-- address_indices compact-array
--- index u8 index to addresses
--- ...
-- data compact-array of u8
-- ...

jcoffland avatar Mar 07 '21 21:03 jcoffland

Thank you for your PR. Unfortunately, we do not have the capacity to add new coins to the firmware right now. Also our current product goal is to unite what we support in firmware and in Trezor Suite and since firmware is way ahead of Suite we want to pause for a bit, implement the remaining coins into Suite and then consider adding new coins. Thank you for your understanding.

tsusanka avatar Mar 09 '21 11:03 tsusanka

@tsusanka, That's too bad. Cryptocurrency technology is moving fast and I would like to see Trezor continue to hold a strong position mainly because of it's commitment to Open-Source.

From my perusal of the Trezor firmware, it could use an overhaul. The merging into the mono-repo, although likely beneficial, left some messes that still need to be cleaned up. Adding a new coin touches many places in the code. A better architecture would isolate coin implementations in a single directory. This would make it much less costly to add new coins. Supporting many coins is going to be essential to staying relevant and to competing successfully with Ledger.

jcoffland avatar Mar 10 '21 21:03 jcoffland

is it possible that SOL will be supported in the December trezor firmware update?

mattsilv avatar Nov 08 '21 16:11 mattsilv

is it possible that SOL will be supported in the December trezor firmware update?

No. This PR is very far from being complete (see my comment from March).

prusnak avatar Nov 08 '21 16:11 prusnak

is it possible that SOL will be supported in the December trezor firmware update?

No. This PR is very far from being complete (see my comment from March).

Oh I missed that, sorry! No worries, keep on making magic happen :)

mattsilv avatar Nov 08 '21 18:11 mattsilv

Thank you for your PR. Unfortunately, we do not have the capacity to add new coins to the firmware right now. Also our current product goal is to unite what we support in firmware and in Trezor Suite and since firmware is way ahead of Suite we want to pause for a bit

I don't think this is a good approach for the development of trezor. Sure, it's understandable that you'd want the trezor suite to be feature complete and help users interact with protocols, but as you've pointed out, this is becoming a bottleneck that hinders development. Third party services like exodous wallet reduce the need for trezor suite to be feature complete, trezor has supported XMR for a while even though the trezor suite doesn't haven't and instead the default way of using it is interfacing with the trezor wallet through the official monero wallet. Many ethereum dapps don't use trezor as web3 provider and it's not uncommon to use trezor through metamask for that purpose. The point I'm getting at, is that third parties can achieve in a decentralised open source manner small chunks of what the trezor suite aims to achieve, and trezor development should be primarily focused on that. In Solana's case, we're talking about the 5th largest in market cap as of time of posting, not even counting metrics like tvl and all applications that are ran there, as of now, a trezor user who wants to interface with that either has to use a hot wallet, get a ledger or make a downstream custom build of the firmware with this scarcely tested PR to use it

boscovn avatar Nov 22 '21 12:11 boscovn

Is anyone on the trezor team able to provide an ETA on when new coins will be considered for firmware? I just got my Model T to replace a Ledger, and am disappointed I'm going to have to keep my Ledger around just for Solana.

@tsusanka mentioned that the Trezor team wanted to "pause a bit" to let suite catch up, but that was a good 8 months ago. I can kinda see that Suite/Invity may be essential for getting a slice of DeFi revenues. But would it really hurt that much to spare some bandwidth and keep Trezor relevant for newer blockchain applications? 8 months is a long time in the crypto space. As @boscovn already said, this isn't a rats race to support every coin, but the top 5 coin by market cap.

mightyguava avatar Nov 24 '21 04:11 mightyguava

Any chance I can compile the firmware myself with this one? Perhaps forking to xxx/trezor-firware-with-solana and give user an instruction to compile their firmware? I like the way trezor function and really want to use it in doing solana transaction.

phuongnd08 avatar Nov 30 '21 07:11 phuongnd08

I see Trezor Suite as a marketing tool, and a mistake on SatoshiLabs strategy. I haven't bought my Trezor T for the Trezor Suite - which of course didn't exist at the time - but for the hardware wallet.

There are many blockchains and more are under development. The developers of each blockchain also develop a wallet to them, and there are third parties who also develop alternative wallets for a blockchain and wallets that support multiple blockchains.

It's not feasible for a single party to develop a software to support all kinds of transactions on all blockchains. That's specially troubling when user wanna interact with web dApps, which require extensions on Chromium and FireFox Quantium at minimum.

These softwares are already available and under development and support, under open source principle.

There's no point in SatoshiLabs to develop a new software that must redo all the work that all these softwares do. The path to go is to provide a great quality (reliable, secure, easy to learn, easy to integrate, easy to use, etc) interface and work with all those groups into integrating this interface into their softwares. And develop only the firmware software to support each blockchain features that require interacting with the private key.

Trezor T already have such interface. So I don't understand why they had stopped working on enhancing the firmware and interface and communication with wallets developers, to develop their own wallet. Which we aren't asking for and don't want. While they keep ignoring us asking for proper support to latest blockchains, for their existing wallet!

It's gonna be very expensive to maintain Trezor Suite and all its useless features, so I fear we'll never have our hardware wallet properly maintained.

HikariWS avatar Dec 06 '21 01:12 HikariWS

@tsusanka @prusnak

current product goal is to unite what we support in firmware and in Trezor Suite and since firmware is way ahead of Suite we want to pause for a bit

This is to much degree achieved by now, with December 2021 release? Please do re-consider.

gbaderg avatar Dec 10 '21 12:12 gbaderg

Would really like to see this in trezor.

DieracDelta avatar Dec 31 '21 18:12 DieracDelta

Would really like to see this in trezor.

I have given up and bought a ledger and staking since then with it

philipyaya2005 avatar Dec 31 '21 18:12 philipyaya2005

I'm also giving up. It's a shame SatoshiLabs keeps ignoring us. It's been 2 years I had asked on reddit when they were gonna add support for ThorChain and they've been with the same answer with no progress, not even an ETA to restart working on the firmware.

I created a softwallet on Solana and am impressed with its quick growth. There are many independent groups with live services for lending, AMM, yield farming, games. step.finance shows NFTs we own, even to date there's no portal that easily does it on ETH. Many traditional tokens are published natively on it and Wormhole has wrappers for many more. It's very cheap (network fee) to invest on a variety of tokens and investment types, even traditional DEXes (daytrading) are back! Discord communities have thousands of members. Solana is receiving services much quicker than ETH did and that other networks like EOS never did.

I'm worried that Solana is still centralized and hope they improve it, but IMO it's currently the best network to be, as long as ETH remains with its high fees.

Providing support for Solana and Phantom should be top priority for SatoshiLabs, specially in respect to us who own Trezor, and to assure the growing cryptomarket user base will buy it.

Many portals offer direct support to Ledger without relying on a middleware wallet. Everybody who sees it will choose to buy Ledger! That's the marketing that SatoshiLabs should be aiming to! Not on a useless wallet suite nobody wants or cares.

As I said, it's easier and quicker to take advantage on the work of all these groups developing wallets than to stay incompatible with them and try to do all the work alone.

HikariWS avatar Jan 01 '22 14:01 HikariWS

@matejcik @mmilata any update on this ? Community is really in need of Solana, Cosmos, Terra ecosystem....

snownoop avatar Feb 23 '22 23:02 snownoop

Please don´t miss the train @prusnak . Enabling Solana ecosystem will open doors to thousands of developers. There is a plan to onboard only 40k of them this year, which means Trezor will stay very popular in these type of ecosystems as it´s more powerful then other solutions. Try to think about it. Thank you!

daxicek avatar Mar 17 '22 10:03 daxicek

Any updates on this?

denizariyan avatar Apr 03 '22 19:04 denizariyan

Please Please Please start considering support for new blockchains ASAP. As a developer and user in the open source community I hate to see the great products in this area start to loose their users and developers due to lack of listening to the users. I know this is YOUR product and you are allowed to choose in which direction you want to lead it. But please remember the most valuable asset to each company is it's users and I believe Trezor has one of the greatest user bases in this industry.

I hope it stays this way and wish the Trezor community to get larger and more active.

Wish you all the best, @prusnak @matejcik

alisinabh avatar Apr 09 '22 13:04 alisinabh

I've seen tons of ppl asking for adding support to not-so-new-anymore blockchains on the firmware, and not a single 1 asking for anything on the Suite.

It's very odd, it's like SatoshiLabs executives wanna kill the company. We're going to 3 years of lack of support, they remain claiming they wanna develop on the Suite all the features existing on the firmware. But shouldn't a desktop software be easier to develop than an embedded chip firmware? How many years did they take to develop the firmware?

And if that was the case, and the project is so massive, why didn't they hire more engineers 4 years ago, when they decided to build the Suite? If it was gonna take so many years, they should have made another team for it, not take firmware team and leave firmware barely supported.

The sad thing is that many Trezor owners are just buying Ledger Nano. I did it and found out its UX isn't that bad. We don't have touch screen, but the 2 buttons work good enough for everything we need, which is signing tx that are created by the open source wallets. For Solana, Ledger Nano firmware isn't even able to create a new account/address... because they preferred to work with Phantom devs to integrate it to the device instead of developing already existing features to the firmware. That's precisely what I suggested SatoshiLabs to do almost 2 years ago.

The only drawback of Ledger Nano is its small storage, I'm able to add to it only 3 blockchains, so I keep using my Trezor T for blockchains it supports. Now with the release of Ledger Nano S+, I'm considering buying it, so I have more storage for more blockchains and a backup device.

HikariWS avatar Apr 09 '22 13:04 HikariWS

I guess we must hold our expectation on trezor low. The product is cool but obviously they have little respect for new altcoins. It's their choice. Ledger serve us well on that. Eventually the one that survive is the one that fit to the market.

On another perspective, if this is an opensource project, why hasn't someone create a forked firmware just for their fav alcoins is beyond my understanding. I know I am lazy and just looking for a solana fork, but it seems the whole community doesnt have a kind hearted guy who would do it

phuongnd08 avatar Apr 10 '22 01:04 phuongnd08

For security oriented softwares, I see open source as fundamental, but for reviewing. I'd not use a 3rd party firmware. Even it being open source too, I won't trust their compiled software. They can add anything they want to the firmware and we won't know it.

HikariWS avatar Apr 10 '22 13:04 HikariWS

I can't believe that SatoshiLabs cares so little about the community. I don't think that it all their resources would be gone if they tried to integrate it in the Phantom Wallet, like @HikariWS said. Sure, Solana isn't perfect but Ethereum, for example, has its flaws too. And the "shitcoin" argument isn't good either. A "shitcoin" wouldn't reach the top 10 and stay there too.

But still, I have a little bit of hope left because Trezor is open source and this could "safe" it.

JustIwanII avatar Apr 12 '22 09:04 JustIwanII

Any updates about this?

zkRemda avatar Aug 04 '22 18:08 zkRemda

Especially with the recent Solana hacks, I would feel much safer storing my SOL on a hardware wallet.

DieracDelta avatar Aug 04 '22 22:08 DieracDelta

Why is trezor being so damn reluctant and devilishly slow on adding more coin support, especially the solid ones like Solana I regret buying this hardware wallet, honestly I cannot store my arweave here nor can I store SOL

let4be avatar Nov 10 '22 07:11 let4be

Any update on this?

karlvlam avatar May 21 '23 16:05 karlvlam

Can we please reconsider adding Solana despite the general (good!) hesitancy to add new coins. A lot changed in the last 2.5 years since the PR was opened:

  • Solana is at number 9 in the global coin rankings on coinmarketcap.com regarding market capitalisation
  • It successfully recovered from multiple incidents/network-breakdowns/hacks/DDoS attacks, over the past 2.5 years. Such incidents, while unfortunate, provide the chance to fix things and improve stability.... and Solana is still there
  • Solana's ecosystem has flourished, attracting numerous decentralised applications (dApps), projects, and developers, see e.g. https://dappradar.com/rankings/protocol/solana
  • High Throughput and Low Fees: Solana's scalability is still impressive, capable of handling thousands of transactions per second, and its low transaction fees set it apart from many other blockchain networks. These attributes make it an attractive choice for users who seek fast and cost-effective transactions.
  • Solang opens Solana to Ethereum’s Solidity developers for smart contracts, see https://solana.com/news/solang-solana-solidity-evm

There are / have been some review comments: What has to be done to finish the PR? How can it be tested? What are good APP candidates to support Trezor with Solana: the Solana cli client, the Trezor App Suite, what else?

dbast avatar Jul 30 '23 17:07 dbast