near / mpc

31 stars 6 forks source link

Update multi-chain contract API #473

Closed volovyks closed 2 days ago

volovyks commented 4 months ago

Description

Propositions are welcomed, here is what I think we should change:

### TODO
- [x] Organize contract API, separate public API
- [x] return result as a struct (key values), not an array
- [ ] return derived user PK that was used in signing (can be done on FE, but it should allow to check the signature on the contract level and make FE life easier, we may have many integrations in the future)
- [ ] return root and user pk as a point or string, not near_sdk::PK
- [ ] ~~prevent payload hash rotation on the client side~~ (does not seem possible)
- [ ] https://github.com/near/mpc-recovery/issues/548
- [ ] https://github.com/near/mpc-recovery/issues/578
- [ ] https://github.com/near/mpc-recovery/issues/593
- [ ] https://github.com/near/mpc-recovery/issues/583
- [ ] https://github.com/near/mpc-recovery/issues/585
- [ ] https://github.com/near/mpc-recovery/issues/579
- [ ] Improve error handling, list all posible errors in enum or using [handle_result]
### Under discussion
- [ ] https://github.com/near/mpc-recovery/issues/513
volovyks commented 4 months ago

Update:

volovyks commented 3 months ago

Blocked on payload vs payload hash decision cc @DavidM-D

volovyks commented 3 months ago

We will continue sending only the hash of the payload.

volovyks commented 2 days ago

Closing in favour of #663