Here’s the basis of the basis on your invitation:
Title: Creation of the JOP (Program Interface) for Reds Signatures in the Tepochka Solana with the Native Program ED25519
Edit
How to disintegrate solana, you, verbathetically, by the language with the tongue programing solana and its covered libraries. However, when it comes to work with the conical cryptographic primiti, so as ED25519, everyone can become an interstate. In this state, we dissatisfied with the creation of JOP (program interface) for the native program ED2519 on Solana.
What is the ED25519 program?
ED25519-is the type of cryptosted key, diluted with the Doussner and Erik Silverberg. This is a pair, stubborn from two components: closed key and an open key. The partial key is used for signatures, in that time, as the open key can be used for the signature.
Native program ED25519 O Solon
To the cozenia, in the correspondence with the documentation of the Solana-Program Crate Native ED25519 does not succeed. This indicates that you will not be able to use the software interface for the unrelenting assimilation with the ed25519 programs.
CPI creation for Native ED25519 Program
To predefine this one, we can make the JOP (program interface), using the luster Solana-Program-cpi. This barn shows the safety and call the policeman program on the solana blockchain.
Here's the primer that you can make a JOP that to check the signature on the storage:
Rust
Use Soolana_program :: {
Account_info :: {NEXT_ACCOUN_INFO, Accountinfo},
Program_error :: Programrror,
PUBKEY :: PUBKY,
};
Const signature_type: & Str = "ED25519";
STRUCT ED25519Signaturetier {
Private_Key: Pubkey,
}
IMP ED25519Signatureiveier {
FN NEW (Private_Key: Pubkey) -> Self {
ED25519Signverifier {Private_Key}
}
FN VERIFY (& Self, Signature: & Accountinfo
// Reverey the open key from information of the cuts
Let Public_key = Next_account_info (Signature) .pubkey.clone ();
// Check Signature with ED2519 Algorithm
Match ED25519 :: Verify (& Public_key, & Signature.value.data (). As_ref ()) {
OK (Proverb) => OK (signature_type.to_string ()),
Err (_) => err (program :: invalidsignure),
}
}
}
FN MAIN () -> Result <(), Programror> {
// Create new IDentifier Program
Let Program_id = Pubkey :: New_unique ("My_program_id");
// Revet the closed key of the score
Let Private_key = Pubkey :: New_unique ("My_PRIVATE_KEY");
// Create ED25519Signverifier with closed key
Let Verifier = ed25519signAatervier :: New (Private_key);
/
Match verifier.verify (& accountinfo {Pubkey: Next_account_info (Pubkey :: New (Unique_identifier! ())}, Program_id) {
OK (signature_type) => println! ("Towed Tip: {}", signature_type),
Err (_) => println! ("Unefined Signature"),
}
Good (())
}
In this one, we delay the structure of ED25519Signutverifier
, which takes the closed key in the quality of the vicinity. We use the cpi for the drill signature on the steady, using the function of ED25519 :: Verify
.
Introduce unichemia that this code prefares that you have the unusual renunciation in your file cargo.toml
:
`Toml
[Availabicity]
Solana-Program = “1.8.0”
Solana-Program-KPI = “0.12.2”
`
conclusion
In the conclusion, the creation of the IPC for the proverbial signatures in the storage of the solana with the native program ED25519 is possible with the use of “solana-deferam-cpi”. This allows you to promote the program with the native ED25519 program, which is not overgrown with the promoted programs.
I hope that this one was polythei! Let me know if you have a question -you need a question or you need to be an add -on.