0

Let's take this token and one of the transactions of it:

https://solscan.io/token/AbnTggpTujbdAiJtyhH9WtK2CqXk44W7GipyJXkopBDd

Looking at one of the transactions, will one always be able to create and, possibly, execute, an identical transaction? Is there always enough info in there, or at least is there always a possibility to deduce needed info from Solana?

Or can there be info that can't be found anywhere publicly?

Particularly, what's createAssociatedAccount? Where to look for it at all?

tardushechka
  • 21
  • 1
  • 5

1 Answers1

0

If you have all of the required private information, you can absolutely create an identical transaction.

Let's look at https://solscan.io/tx/2EkndYmogcyHEcckfvaYmLXcqvvWC1AutSZE77y1gsDsCSS15PQ5sWV4NNZwqx7qUvNkN7H8GhmDZ8hE35dj98fP as an example. This transaction contains an instruction to transfer 620 tokens of mint AbnTggpTujbdAiJtyhH9WtK2CqXk44W7GipyJXkopBDd from AqUzLDLJ1LhLv9gERjEn78j4PMEpvyWJpkSTuWQ54KwD to EdkpJiv7hgspKcEeYL9JmDaipRQH6rd9xTySZwxB3Whg, signed by GrX7rZAjCFH9htKfuxYEMGNSg1mDnr5dmwYhBgVmgdvR. The only private part here is the signature by GrX7rZAjCFH9htKfuxYEMGNSg1mDnr5dmwYhBgVmgdvR, so you would need the private key in order to sign a new transaction.

On the other hand, if you duplicate the exact transaction as is, and resend it to the network, it will get dropped as a duplicate. You need a new signature referencing a new blockhash (https://docs.solana.com/terminology#blockhash), which requires the private key.

As for createAssociatedTokenAccount, it's a standard for associating a token account to an owner. More info can be found at https://spl.solana.com/associated-token-account

Jon C
  • 7,019
  • 10
  • 17
  • I mean, not identical 100%, but 99.9% identical; therefore, it'd work – tardushechka Nov 16 '21 at 05:42
  • 1) How can there be private information, if everything should be on blockchain, hence public? – tardushechka Nov 16 '21 at 05:43
  • 2) In my example, it's `createAssociatedAccount`, and not `createAssociatedTokenAccount`; if they're the same, what says so? – tardushechka Nov 16 '21 at 05:43
  • 1) Signatures are public, but they are generated by a private key. This is how essentially all permissioning works on a public blockchain. You have funds in your wallet, which should only be transferable by you. Without these signatures, anyone could spend anyone else's tokens! Perhaps the wallet guide will make this clearer: https://docs.solana.com/wallet-guide – Jon C Nov 16 '21 at 11:47
  • 2) Seems like it's just how SolScan displays things. Instructions are just bytes of data, so it's up to the explorer to display it in a way that's human-readable. You can cross-reference SolScan with another explorer to see that. Here's one transaction in SolScan https://solscan.io/tx/3z7FSmF1enh6eYN8QgvXMFWG2intQPQssb5BxrdznA7aXp6pF7mNVP7yncCnqwUkS7acZUWrUM1h8MTcqckrMQ9t and in the Solana explorer https://explorer.solana.com/tx/3z7FSmF1enh6eYN8QgvXMFWG2intQPQssb5BxrdznA7aXp6pF7mNVP7yncCnqwUkS7acZUWrUM1h8MTcqckrMQ9t -- they call it different things, but it's the same concept – Jon C Nov 16 '21 at 11:50
  • 1) Alright, but still doesn't affect the answer to my question because I'll have my own private keys anyway. Therefore, my question remains: do the explorers contain all necessary information to copy, slightly modify and then execute a random transaction? – tardushechka Nov 16 '21 at 17:16
  • 1) Yes, but only if you can sign for all of the accounts present in the transaction. In the example of https://explorer.solana.com/tx/3z7FSmF1enh6eYN8QgvXMFWG2intQPQssb5BxrdznA7aXp6pF7mNVP7yncCnqwUkS7acZUWrUM1h8MTcqckrMQ9t you would need the private key for `Hup4sM5moYsDk9M1sHUuPoY7yew8dPsvgJi4gXKfb6ZQ` – Jon C Nov 16 '21 at 22:42
  • 1) How have you deduced that `Hup4sM5moYsDk9M1sHUuPoY7yew8dPsvgJi4gXKfb6ZQ` requires to be signed at all? With a private key. – tardushechka Nov 17 '21 at 01:02
  • If you look at the first line under "Account Input(s)", under the "Details" section, `Hup4sM5moYsDk9M1sHUuPoY7yew8dPsvgJi4gXKfb6ZQ` is listed as "Signer". I can't attach a screenshot to comments to show you, unfortunately. – Jon C Nov 17 '21 at 10:49