Skip to content

feat/near chain signatures support #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

EdsonAlcala
Copy link

@EdsonAlcala EdsonAlcala commented Mar 13, 2025

Description

This PR adds support for the NEAR protocol chain signatures, that allows a NEAR protocol account to control other accounts/addresses across multiple chains.

In order to enable the chain signatures support a NearKeyPairWalletProvider was required.

The PR also includes an example bot.

The following actions contain the functionality of the NEAR protocol chain signatures:

  • get cross chain address
  • get cross chain public key
  • sign payload

Tests

  • Added unit tests
  • Testet prompts

Sign payload

Chatbot: typescript/examples/langchain-near-chatbot/chatbot.ts
Network: near-testnet
Setup: Users will be able to create a NEAR account

Prompt: sign me this payload "0x470637f6dcc98931d6d22afa2b491c20caf0c3ba595d707606fe7915c30ef0a7" using chain signatures 

-------------------
The signature result is big_r: 02ACE91E6368E5859640CB8E988D70E6C1551E3B8AEC897084C5A2797EF606CCE8, big_s: 3A84B3C0C157FFE0AC271A07F6ABB4BA8821E010F359FAEE05D82796122926F2 and recovery_id: 0
-------------------

The payload has been successfully signed. Here are the signature details:

- **big_r**: 02ACE91E6368E5859640CB8E988D70E6C1551E3B8AEC897084C5A2797EF606CCE8
- **big_s**: 3A84B3C0C157FFE0AC271A07F6ABB4BA8821E010F359FAEE05D82796122926F2
- **recovery_id**: 0

Let me know if you need any further assistance!

Get cross chain public key

Chatbot: typescript/examples/langchain-near-chatbot/chatbot.ts
Network: near-testnet
Setup: Users will be able to create a NEAR account

Prompt: what is the cross chain public key for the account sample.testnet

-------------------
Computed public key for account id sample.testnet, network near-testnet and derivation path account-1 is 0433cea8fa3b41fa277d16af5895aca4bcea550470a40dfaa4aaff3d7eafeb5b1bf13e9b6d8e55a3f2ecba326a3e79002d601835a0b16848b040653360e4ba411d
-------------------
The cross-chain public key for the account "sample.testnet" on the NEAR testnet with the derivation path "account-1" is:

**Public Key**: 0433cea8fa3b41fa277d16af5895aca4bcea550470a40dfaa4aaff3d7eafeb5b1bf13e9b6d8e55a3f2ecba326a3e79002d601835a0b16848b040653360e4ba411d

If you need any more help, feel free to ask!

Checklist

A couple of things to include in your PR for completeness:

  • Added documentation to all relevant README.md files
  • Added a changelog entry

@cb-heimdall
Copy link

cb-heimdall commented Mar 13, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions bot added documentation Improvements or additions to documentation action provider New action provider wallet provider New wallet provider example New example agent typescript labels Mar 13, 2025
@EdsonAlcala EdsonAlcala changed the title wip: Feat/near chain signatures support Feat/near chain signatures support Mar 17, 2025
@EdsonAlcala EdsonAlcala marked this pull request as ready for review March 17, 2025 16:29
@EdsonAlcala EdsonAlcala changed the title Feat/near chain signatures support feat/near chain signatures support Mar 17, 2025
@EdsonAlcala EdsonAlcala force-pushed the feat/near-chain-signatures-support branch from 53a5467 to 47e1901 Compare March 21, 2025 09:40
@github-actions github-actions bot added framework extension New framework extension python labels Mar 21, 2025
@EdsonAlcala EdsonAlcala force-pushed the feat/near-chain-signatures-support branch from 47e1901 to a0e0917 Compare March 21, 2025 10:14
@github-actions github-actions bot removed framework extension New framework extension python labels Mar 21, 2025
@EdsonAlcala
Copy link
Author

hey @murrlincoln, any comments on this PR? Thanks

@EdsonAlcala
Copy link
Author

@CarsonRoscoe let me know what are your thoughts. Best

@EdsonAlcala
Copy link
Author

EdsonAlcala commented Apr 18, 2025

@CarsonRoscoe @murrlincoln I would like to ask you what is the criteria to merge and review PRs. Considering more recent PRs like #665 was merged before this one.

In general this PR has been open since March 13, that means after 36 days we are still here waiting and I have applied all your changes and suggestions.

No more changes have been required from our side.

If there are doubts or suggestions I'm happy to jump on a call and discuss about it. On the other hand, if the PR is not up to your coding standards or is not welcome you can also let me know. Because I have been constantly rebasing and merging and there is not clarity with it. I mean not even the pipeline has run.

@EdsonAlcala
Copy link
Author

@CarsonRoscoe @murrlincoln Is this really the way to treat contributors?

@EdsonAlcala
Copy link
Author

@CarsonRoscoe @murrlincoln any updates?

@EdsonAlcala
Copy link
Author

EdsonAlcala commented May 29, 2025

any updates on this? @CarsonRoscoe @murrlincoln

1 similar comment
@EdsonAlcala
Copy link
Author

any updates on this? @CarsonRoscoe @murrlincoln

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action provider New action provider banana documentation Improvements or additions to documentation example New example agent typescript wallet provider New wallet provider
Development

Successfully merging this pull request may close these issues.

4 participants