> For the complete documentation index, see [llms.txt](https://8bit-1.gitbook.io/solibrary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://8bit-1.gitbook.io/solibrary/umi-and-web3js-differences.md).

# Umi and Web3js Differences

When using Umi you may come across some differences between Umi and solana web3js.

Although having the same or similar import names these function differently and are not compatible between the two librarys out the box.

#### PublicKeys <a href="#public-keys" id="public-keys"></a>

Umi PublicKey

JavaScript

```
import { publicKey } from '@metaplex-foundation/umi'
const publicKey = publicKey('tst24HZ6pbcnraCv4r8acexfgXvyQwMSRgZRCg9gEX1')
```

Solana Web3js PublicKey

JavaScript

```
import { PublicKey } from '@solana/web3js'
const publicKey = new PublicKey('tst24HZ6pbcnraCv4r8acexfgXvyQwMSRgZRCg9gEX1')
```

These are just basic examples. To learn more about Umi's keypairs check out [PublicKeys and Signers](https://developers.metaplex.com/umi/public-keys-and-signers). There are also converters between both Umi and web3js [Web3Js Adapters](https://developers.metaplex.com/umi/web3js-adapters)

#### Keypairs <a href="#keypairs" id="keypairs"></a>

Umi Keypair

JavaScript

```
const umi = createUmi(...)
const keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secretKey))
```

Web3js Keypair

JavaScript

```
import { Keypair } from '@solana/web3js'
const publicKey = Keypair.fromSecretKey(new Uint8Array(JSON.parse(Wallet.DEV1)))
```

These are just basic examples. To learn more about Umi's keypairs check out [PublicKeys and Signers](https://developers.metaplex.com/umi/public-keys-and-signers). There are also converters between both Umi and web3js keypair types [Web3Js Adapters](https://developers.metaplex.com/umi/web3js-adapters)

#### Transactions <a href="#transactions" id="transactions"></a>

Umi Transaction

JavaScript

```
const blockhash = await umi.rpc.getLatestBlockhash()

const transaction = const tx = umi.transactions.create({
    version: 0,
    payer: umi.identity.publicKey,
    instructions: ix,
    blockhash: blockhash.blockhash,
  });

await umi.rpc.sendTransaction(tx)
```

Web3js Transaction

JavaScript

```
const wallet = useWallet()

const messageV0 = new TransactionMessage({
  payerKey: SIGNER_WALLET.publicKey,
  recentBlockhash: latestBlockhash.blockhash,
  instructions: txInstructions,
}).compileToV0Message()

const tx = new VersionedTransaction(messageV0)

// send via useWallet hook
await wallet.sendTransaction(tx)
//or send via connection
await connection.sendTransaction(tx)
```

These are just basic examples. To learn more about Umi's Transiactions check out [Transactions](https://developers.metaplex.com/umi/transactions). There are also converters between both Umi and web3js Transaction types [Web3Js Adapters](https://developers.metaplex.com/umi/web3js-adapters)
