Comments (7)
💪1️⃣💎
from one-wallet.
A third alternative is to alter 1 and validate signature differently, if the sender of the transaction is a contract. Since StakingTransaction
relies on (r, s, v) signature values to calculate the sender's address, we should be extend StakingTransaction
to accept a new type of StakingMsg
and to include the contract's address, as well as the proof needed for validation. The validation of proof can be a call to a function on the contract (isValidSignature per EIP-1271), or hard-coded in Go similar to the flow in https://github.com/polymorpher/one-wallet/blob/master/code/contracts/ONEWallet.sol#L171.
At runtime, the client submits the staking request directly via hmy_sendrawstakingtransaction
RPC call using the altered StakingTransaction
structure proposed above.
This alternative requires much less modification compared to (2). It does not venture into customizing EVM and only customizes components that are already customized (RPC servers).
from one-wallet.
A third alternative is to alter 1 and validate signature differently, if the sender of the transaction is a contract. Since
StakingTransaction
relies on (r, s, v) signature values to calculate the sender's address, we should be extendStakingTransaction
to accept a new type ofStakingMsg
and to include the contract's address, as well as the proof needed for validation. The validation of proof can be a call to a function on the contract (isValidSignature per EIP-1271), or hard-coded in Go similar to the flow in https://github.com/polymorpher/one-wallet/blob/master/code/contracts/ONEWallet.sol#L171.At runtime, the client submits the staking request directly via
hmy_sendrawstakingtransaction
RPC call using the alteredStakingTransaction
structure proposed above.This alternative requires much less modification compared to (2). It does not venture into customizing EVM and only customizes components that are already customized (RPC servers).
The 3rd option is a viable option but it seems to me very hacky. It's altering staking txn structure and also staking txn validation logic, which is as heavy-weight as option 2 I think (the difference is it's not touching evm). Actually I think the option 2 is more elegant and generic and will help all other smart contract staking operations. I would prefer to go with option 2 even though it may take more time to implement.
Btw, we are making good progress on account abstraction: harmony-one/bounties#35. Though I don't think it will save us from having to change the staking logic on our side.
from one-wallet.
Btw, we are making good progress on account abstraction: harmony-one/bounties#35. Though I don't think it will save us from having to change the staking logic on our side.
@rlan35 When do you think it will be ready on testnet or mainnet?
from one-wallet.
Gnosis Safe is sort of handling contract signatures via options 3, by accepting the case that v=0
and using a variable length signature. See https://github.com/gnosis/safe-contracts/blob/34c87b783dfd04ff09ef7c358c3182c3c151e086/contracts/GnosisSafe.sol#L257
from one-wallet.
As of today, delegate and undelegate are added as smart contract functions (pre-compiled) on Harmony. Staking support on 1wallet is set to be added in mid March. harmony-one/harmony#3906
from one-wallet.
Fixed by #268
from one-wallet.
Related Issues (20)
- Self-hosted RPC nodes with fast confirmations, health and performance monitoring, and service guarantees HOT 1
- Smart contract test framework HOT 1
- Smart contract tests with 90% operation coverage HOT 1
- Domain transfer from old wallet is failing silently in v16, and reclaim does not work
- Relayer analytics and metric reporting endpoints HOT 3
- MultiSig Withdrawal HOT 18
- Satellite wallets - enabling transfer to exchange accounts and importing existing wallets (such as MetaMask)
- 1Wallet transaction to exchange account . How can they retrieve it? HOT 1
- Relayer stats visualizations and more granular error classification
- Improve accuracy of Number of Wallets and Balance on ONEWallet SideBar HOT 3
- Recovery is repeatedly showing error (Money stuck) HOT 11
- Can't request contract call HOT 2
- Updating Wallet & missing ONE Tokens HOT 11
- ONE tokens did not arrive to 1wallet HOT 4
- Emergency!! About to lose all funds in wallet due to expiration on an older version wallet. HOT 5
- Funds Not Unstake on Recovery from Recovery Address HOT 4
- can't send my tokens HOT 1
- How to recover funds when 1Wallet is expired? HOT 15
- Failed to commit : network error on any transaction I try to make HOT 2
- Network errors - cannot do anything? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from one-wallet.