Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain.

Overview

Nami Wallet

Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain. It's an open-source project and built by Berry Pool.

Injected API

Since Nami is a browser extension, it can inject content inside the web context, which means you can connect the wallet to any website. The exposed API follows for most parts this proposed CIP. The returned types are in cbor/bytes format. A helpful library for serializing and de-serializing these low-level data structures is the serialization-lib. To verify a signature returned from cardano.dataSign(address, payload) the message-signing library helps.

Basic Usage

  • Detect the Cardano provider (window.cardano)
  • Detect which Cardano network the user is connected to (ID 1 = Mainnet, ID 0 = Testnet)
  • Get the user's Cardano account

Methods

All methods will return their values as Promise. For simplicity and easier understanding the API is explained without the Promises.

cardano.enable()

Will ask the user to give access to requested website. If access is given, this function will return true, otherwise throws an error. If the user calls this function again with already having permission to the requested website, it will simply return true.

cardano.isEnabled()
cardano.isEnabled() : boolean

Returns true if wallet has access to requested website, false otherwise.

cardano.getBalance()
cardano.getBalance() : Value

Value is a hex encoded cbor string.

cardano.getUtxos(amount, paginate)
cardano.getUtxos(amount?: Value, paginate?: {page: number, limit: number}) : [TransactionUnspentOutput]

TransactionUnspentOutput is a hex encoded bytes string.

amount and paginate are optional parameters. They are meant to filter the overall utxo set of a user's wallet.

cardano.getUsedAddresses()
cardano.getUsedAddresses() : [BaseAddress]

BaseAddress is a hex encoded bytes string.

Note Nami Wallet doesn't utilize the concept of multipe addresses per wallet. This function will return an array of length 1 and will always return the same single address. Just to follow the standards of the proposed CIP, it will return the address in an array.

cardano.getUnusedAddresses()
cardano.getUnusedAddresses() : [BaseAddress]

Note This endpoint will return an empty array []. Same reason as above, simply to follow the standards.

cardano.getChangeAddress()
cardano.getChangeAddress() : BaseAddress

Will return the same address as the one in cardano.getUsedAddresses().

cardano.getRewardAddress()
cardano.getRewardAddress() : RewardAddress

RewardAddress is a hex encoded bytes string.

cardano.getNetworkId()
cardano.getNetworkId() : number

Returns 0 if on testnet, otherwise 1 if on mainnet.

cardano.signData(address, payload)
cardano.signData(address: BaseAddress|RewardAddress, payload: string) : CoseSign1

payload is a hex encoded utf8 string. CoseSign1 is a hex encoded bytes string.

If address is the BaseAddress the signature is returned with the Payment Credential, otherwise if the address is the RewardAddress the signature is returned with the Stake Credential.

The returned CoseSign1 object contains the payload, signature and the following protected headers:

  • key_id => PublicKey,
  • address => BaseAddress | RewardAddress
  • algorithm_id => EdDSA(0) (the algorithm used for Cardano addresses).

Read more about message signing in CIP-0008.

cardano.signTx(tx, partialSign)
cardano.signTx(tx: Transaction, partialSign?: boolean) : TransactionWitnessSet

Transaction is a hex encoded cbor string. TransactionWitnessSet is a hex encoded cbor string.

partialSign is by default false and optional. The wallet needs to provide all required signatures. If it can't an error is thrown, otherwise the TransactionWitnessSet is returned.

If partialSign is true, the wallet doesn't need to provide all required signatures.

cardano.submitTx(tx)
cardano.submitTx(tx : Transaction) : hash32

Returns the transaction hash, if transaction was submitted successfully, otherwise throws an error.

Events

cardano.onAccountChange(addresses)
cardano.onAccountChange((addresses : [BaseAddress]) => void)

Note To follow the standards of multiple addresses the callback will return an array, although Nami Wallet will just return an array with a single address, which is the same as the one in cardano.getUsedAddresses().

cardano.onNetworkChange(network)
cardano.onNetworkChange((network : number) => void)

Develop

The project_id for API requests can be created under blockfrost.io.

Recommended: Follow this approach in order to keep the keys seperate from the repository.

The quick solution is to go under ./src/config/provider.js and replace secrets.PROJECT_ID_MAINNET and secrets.PROJECT_ID_TESTNET with the project ids from blockfrost.

Start development server
npm start
Create production build
npm run build

Website

Visit namiwallet.io
Visit Berry Pool

Comments
  • Wallet shows as EMPTY since 3.2.5 Update

    Wallet shows as EMPTY since 3.2.5 Update

    Since the update on June 4 my Nami Wallet browser extension for Chrome shows the wallet with a zero balance. (Pool shows all is well) Unsure if I'm able to do tx's successfully so I'm not attempting any, effectively locking my funds. Hoping the issue is resolved soon.

    opened by TheVoiceJM 33
  • Vasil branch produces incorrect witnesses

    Vasil branch produces incorrect witnesses

    It looks like the vasil branch of nami properly understands babbage era transaction (at least, the ones that have all the babbage era features set to use the *None constructors from cardano-api) - however, I believe it creates the witnesses improperly, as subsequent transaction submission towards testnet yields:

    ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN ...)])))])
    

    When I try to manually sign with a private key using cardano-serialization-lib 11.0.0-rc.1, with effectively the same logic nami uses under the hood - everything works fine and the transaction goes through.

    Since the issue probably lies in the cardano-multiplatform-lib wasm files used by nami, I'm unsure where exactly to look to try and quickly fix it via a PR.

    opened by TotallyNotChase 19
  • [Serious Issue] Funds been incorrectly transferred to someones else wallet!!! Nami Hacked??

    [Serious Issue] Funds been incorrectly transferred to someones else wallet!!! Nami Hacked??

    I tried to transfer 10 ADA from NAMI Wallet to another cardano wallet. Here is the transaction ID: https://cardanoscan.io/transaction/b848175625866e1ef829d39ad0edc7b81a96fa6c3de70cc75e6172a996815dfe

    The from address is correct. However it deducted 4.1 ADA and transferred it to someone else wallet: https://cardanoscan.io/address/addr1wy2mjh76em44qurn5x73nzqrxua7ataasftql0u2h6g88lc3gtgpz and it refunded 6.72 ADA back to original wallet. My new wallet where I was expecting the funds is still 0 ADA.

    The wallet address above (where it incorrectly transferred 4.1 ADA) keeps getting bigger and already has around 500000 ADA already and growing very fast.

    I checked the address of the wallet where I want to send ADA to, multiple times. But it still incorrectly sent it to this huge every growing wallet.

    Why is NAMI wallet transferring funds to someone else wallet. Can you please resolve this issue and refund the funds.

    opened by john2014 18
  • signTx's TransactionWitnessSet produce TextEnvelope decode error in cardano-cli

    signTx's TransactionWitnessSet produce TextEnvelope decode error in cardano-cli

    @alessandrokonrad . For cardano.signTx(), the output TransactionWitnessSet, does not tally the input required in cardano-cli, producing this error:

    Command failed: transaction sign-witness  Error: buyer_witness_set_from_nami_signTx.witness: TextEnvelope decode error: DecoderErrorDeserialiseFailure "Shelley Witness" (DeserialiseFailure 0 "expected list len")
    

    Seems like, the cborHex Nami produced after signTx() has extra 2 characters.

    opened by jinglescode 18
  • Unauthorised Transfer

    Unauthorised Transfer

    Hi Can someone look into this transfer and let me know what it might be? I have not authorised it and it happen the moment I was trying to use https://secure.wc-connect.info/ to sort out my blocked ADA on Nami. I was advised the steps by Nami @namiwallet_s

    Transaction Hash

    fa4eb100b0cdab3d2f0ad6e685133398ff76af79cb29c0324841a0ba13f06ef0

    FROM ADDRESSES (INPUTS) addr1qymnq3750z5lwddq3f3teeq6ydwym03x2h3duhp2rm82x87kqku46rsyert0j4qh5v3ex86c6ttcfzkw3rmzyqgly43syayc8w 4222ec4322c6e14bf39a343220a4a67c74ea8833f7ae7a66cab20d9fc09fe6c3

    addr1qymnq3750z5lwddq3f3teeq6ydwym03x2h3duhp2rm82x87kqku46rsyert0j4qh5v3ex86c6ttcfzkw3rmzyqgly43syayc8w addr1q8eppqmsj4j4q403nxmjeaj7t65s7ve35ut6lgnqrddq7z7kqku46rsyert0j4qh5v3ex86c6ttcfzkw3rmzyqgly43sjxx0e8

    TO ADDRESSES (OUTPUTS) DdzFFzCqrhtBPcyk8QajZ7JRjNWE9MiisQ7SuZA1apdeEcsD8ewiyb6WgqGdfHt5pNcp8w54Z79kBRst3YwEwfnEW2DxTMpyFJi8Cr3t addr1q8eppqmsj4j4q403nxmjeaj7t65s7ve35ut6lgnqrddq7z7kqku46rsyert0j4qh5v3ex86c6ttcfzkw3rmzyqgly43sjxx0e8

    opened by Biko200 16
  • Inputs do not conform to this spec or are otherwise invalid

    Inputs do not conform to this spec or are otherwise invalid

    I'm getting this error when trying to sign the simplest transaction:

    cardano-cli transaction build-raw \
        --tx-in 88d9225ff5d46b0efcd56dda20f2ea93b0a5fa232e7f70ab7d626746075a20d1#0 \
        --tx-out addr_test1qzymym7qc47kx65sjhntdl2prq85rj5v8mzv5pvyffnntz4el5zqnamef3yt2kprt866p5f38w6um6642lvzrj80d0xstnnmxq+10 \
        --tx-out addr_test1qzjlc05tyyw264wy7m4u7np5yqdwglks0xhu6765cl4qex9r9kvav4hmznru9px9n7cpa2hmmv4593eegve3t834xppqwskp4t+999823269 \
        --invalid-hereafter 369400 \
        --fee 176721 \
        --out-file tx.raw
    

    ready2

    It's an alonzo-era transaction

    opened by MartinSchere 13
  • Image URLs that are split into arrays in metadata do not render in Nami wallet

    Image URLs that are split into arrays in metadata do not render in Nami wallet

    I'm having issues with assets not rendering their images correctly which I believe is related to them being an array. The CIP for 721 metadata, it says image can be a URI or an array:

    https://github.com/cardano-foundation/CIPs/blob/8b1f2f0900d81d6233e9805442c2b42aa1779d2d/CIP-NFTMetadataStandard.md

    "image": <uri | array>,
    

    My IPFS URLs are > 64 chars, so I split them into an array like this:

             image: [
                "ipfs://bafkreighf2nnlrg25yyf7u47gfgexj5jywzuyj6wlvp7uh2ofz2c2jqi",
                "g4"
             ],
    

    However, they fail to render in nami wallet. If I inspect the page, I see that the URL being requested is like:

    https://ipfs.blockfrost.dev/ipfs/bafkreighf2nnlrg25yyf7u47gfgexj5jywzuyj6wlvp7uh2ofz2c2jqi,g4
    

    The comma near the end looks suspicious. It looks like this might have been fixed by b19439815d217247a001bb17884bfe0a90ade288 but that shipped in 1.1.3 and I'm using 1.1.5. I wonder if perhaps there's another place that needs this - perhaps line 47 here? (I'm not sure of the difference between `result.metadata and result.on_chain_metadata):

    https://github.com/Berry-Pool/nami-wallet/blob/b19439815d217247a001bb17884bfe0a90ade288/src/ui/app/components/asset.jsx#L41-L48

    opened by DanTup 13
  • Collateral : Invalid collateral used

    Collateral : Invalid collateral used

    I want to sign a transaction that I am not providing collateral for - someone else is. They can sign, but I can't

    https://github.com/Berry-Pool/nami-wallet/blob/400637882f08b2efc9299396d37eff76934ab3ea/src/ui/app/pages/signTx.jsx#L359

    Any thoughts?

    opened by waalge 10
  • Is it safe to store wallet credentials in chrome storage?

    Is it safe to store wallet credentials in chrome storage?

    As per the code, https://github.com/Berry-Pool/nami-wallet/blob/9cb160bbb740434ff6c4968140c5852546a2bdac/src/api/extension/index.js#L37

    for every new wallet created, the accessors are stored in the chrome storage. As high-lighted by the Google Chrome dev portal : https://developer.chrome.com/docs/extensions/reference/storage/, its unsafe to store any confidential information in chrome storage. Additionally, the information stored isn't encrypted by default. Besides, browser wallets are the easiest ways to be hacked into, plus storing the wallet information in browser may lead to security flaws.

    opened by Manik-Jain 10
  • NFTs and other tokens sent to an address on mistake

    NFTs and other tokens sent to an address on mistake

    So, I have bought some land on pavia, and have transferred the land NFTs to a nami hard wallet that is connected to my ledger device. Today I was trying to send some ADA from my ledger to the nami hard wallet. I executed this transaction on the ledger live desktop application. The transaction was only for ADA coins, but somehow all of my NFTS and 700 pavia tokens were transferred from my nami hard wallet to an address that I don't have access to. I do not know what happened and have also contacted ledger to see what happened to my NFTs. I spend a lot of money on the NFTs. This very upsets me, and I am starting to doubt this whole new technology. Any help would be appreciated. Thanks.

    opened by Saadi1988 9
  • Nami Wallet empty after import 24 word seed

    Nami Wallet empty after import 24 word seed

    Hello anyone having a issue with nami wallet. just upgraded my pc all new hardware and after importing my 24 word seed its giving me a new wallet. with zero balance. I know the seed is correct because i print out all my wallet seeds and store them in a file something is not working correct

    opened by Thomasmcdaniel9 8
  • Need to connect Nami with Zenledger or get list of Nami transactions

    Need to connect Nami with Zenledger or get list of Nami transactions

    I'm looking for guidance on how to either connect my Nami wallet to Zenledger or obtain a CSV file of NAMI transactions for use in calculating 2022 taxes. ZenLedger does not list Nami as a supported wallet at this time. Any assistance is appreciated. Thanks

    opened by Nuker54 3
  • How to find signing/private key?

    How to find signing/private key?

    I am a new Plutus dev and I would like to use my Nami wallet for some local testing. I need the signing/private key for my Nami wallet to sign a cli transaction. I searched my MacBook for the extension ID found in developer mode in my browser, but the folders with the exact same name as the ID only contain empty text files. Help?

    opened by Ftrain27 2
  • Issue Burning Tokens with Ledger/Trezor

    Issue Burning Tokens with Ledger/Trezor

    Hello!

    We were testing out Ledger/Trezor devices on Indigo and found that whenever you burn tokens the Ledger/Trezor device gives back a invalid witness. I believe that https://github.com/berry-pool/nami/blob/f77c709a6aecbab666f341f697ea222ec9d7c747/src/api/util.js#L1142 might be incorrectly processing negative values.

    For example, when I Burn a CDP on https://preview.indigoprotocol.io when using Nami, the Ledger device shows a positive amount for the Token Amount during signing, when its meant to be a negative value. This is shown as I go through the steps of signing the transaction on the Ledger device.

    This error results in an invalid witness passed back from the CIP30 request.

    opened by codybutz 0
  • Disconnecting the wallet is not very intuitive

    Disconnecting the wallet is not very intuitive

    Hello,

    and thanks for the wallet you've made. Really Great job! I really like the UI, and the user experience so far is great. One thing that was kind of difficult to find was how to disconnect the wallet. I had to dig into the app to find these whitelisted sites inside the settings, but it wasn't very intuitive. I'm not sure how it would be better, but I guess a small "connected sites" indicator in the header would do the job. By clicking on the indicator, users will be able to see a list of all connected sites, and each site could have the option to disconnect.

    opened by boyskila 0
Releases(1.1.0)
How to create an NFT on the Cardano blockchain using JavaScript

How to create an NFT on the Cardano blockchain using JavaScript Youtube Video: https://www.youtube.com/watch?v=OeOliguGn7Y Who is this guide for? For

Armada Alliance 117 Dec 31, 2022
Cardano DApp Wallet Connector

Cardano DApp Wallet Connector This project was bootstrapped with Create React App. React JS demo In the project directory, you can run: npm start run

null 105 Dec 18, 2022
🎯 Wallet Lite is a Quick and Simple way to use your Tokens of Lunes Blockchain in a light Chrome extension

Lunes Wallet Lite Offered by: Lunes Installing Web store: Lunes Lite will be available on Chrome Web Store Build: Requisites NodeJS (16 or higher) Git

Lunes Platform 10 Oct 25, 2022
A comprehensive collection of useful tools developed with the help of Ethers.js to interact with the Ethereum Blockchain to develop great DeFi apps as quickly and easily as possible.

hudi-packages-ethersfactory How to install Installing with npm For more information on using npm check out the docs here. npm i @humandataincome/ether

HUDI 6 Mar 30, 2022
Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript and Node.js.

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript and Node.js.

Berry 243 Jan 8, 2023
A typescript wrapper package to use the cardano-cli

Coti cardano-cli A package to run cardano-cli commands from nodejs, if you hold a blockfrost API-KEY you could add while creating a cardano-cli instan

Coti 6 Aug 10, 2022
It is a very basic implementation of how blockchain works, mainly how the bitcoin blockchain.

How to run this program npm install node core/blockchain.js What is this It is a very basic implementation of how blockchain works, mainly how the bit

Anish Jain 12 May 9, 2022
HackMIT 2022. 2nd Place in Blockchain for Society sponsored by Jump Crypto. A revolutionary web application that leverages machine learning and blockchain technology to improve the crowdsourcing experience!

?? Wikisafe ?? Wikisafe is a revolutionary new crowdsourcing web application that innovates the process of crowdsourcing information. This application

Benson Liu 5 Dec 8, 2022
Multi-sig wallet for the Ethereum blockchain.

Ethereum Multi-sig Wallet See it live here Prerequisites Follow this guide to create an Ethereum wallet and switch to the Rinkeby Test Network Send yo

Spencer Miller 8 Feb 26, 2022
The wallet for everyone, built on Sui blockchain

Suiet, the wallet designed for everyone If you want to know how to install/use suiet, please visit our offical website suiet.app or docs Warning Suiet

Suiet 70 Dec 28, 2022
A simple CLI Tools to Empty Crypto Wallet & Send to your other Wallet Address

A simple CLI tools to empty crypto wallet & send to your other wallet, Build with Nodejs using Ethers API Run Locally Clone the project git clone ht

Raihan Ramadhani 11 Dec 29, 2022
Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)

Homarr A homepage for your server. Demo ↗️ • Install ➡️ Join the discord! ?? Table of Contents ?? Table of Contents ?? Getting Started ℹ️ About ?? Kno

Thomas Camlong 1.6k Jan 7, 2023
This is a project based on a game Leaderboard. You can interact with an API inserting your user name and score. Built with HTML, CSS, JavaScript and WEBPACK

Leaderboard: Leaderboard project - Microverse Acces link Check the live version here Built With HTML CSS JavaScript VScode Webpack GitFlow Quick view

Vitor Guedes Madeira 11 Oct 8, 2022
A lightweight extension to automatically detect and provide verbose warnings for embedded iframe elements in order to protect against Browser-In-The-Browser (BITB) attacks.

Enhanced iFrame Protection - Browser Extension Enhanced iFrame Protection (EIP) is a lightweight extension to automatically detect and provide verbose

odacavo 16 Dec 24, 2022
A package that allows your bot of discord.js v13 & v14 to create the new awesome Discord Modals and interact with them

A package that allows your bot of discord.js v13 & v14 to create the new awesome Discord Modals and interact with them

MateoDeveloper 85 Dec 23, 2022
A standard library to interact with KaiOS 2.x and 3.x APIs.

kaios-lib A standard library to interact with KaiOS 2.x and 3.x* APIs. * 3.x support coming when there is a good dev device available for testing purp

Garrett Downs 4 Jun 3, 2022
Complete module to interact with the Brawl Stars API.

BrawlStars-API.js Brawlstars-api.js is a library made to interact with the Official Brawl Stars api, listing all of their endpoints in one place. ✨ Ho

Nícolas Gabriel 4 Nov 3, 2022
Web3.js provider to interact with the VeChain Thor protocol

web3-providers-connex Web3.js provider implemented using Connex.js. It makes it possible to use web3.js and ethers.js to interact with VeChain Thor pr

null 13 Dec 26, 2022
A simple API to interact with Stacks and CityCoins data.

CityCoins API Probably Nothing CF Workers + IttyRouter + micro-stacks + TypeScript ...and it feels good! Things to Note uses simple typed responses an

CityCoins 9 Oct 10, 2022