code: func (w *wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Account, error) {
  	// Try to derive the actual account and update its URL if successful
  	w.stateLock.RLock() // Avoid device disappearing during derivation
  
  	if w.device == nil {
  		w.stateLock.RUnlock()
  		return accounts.Account{}, accounts.ErrWalletClosed
  	}
  	<-w.commsLock // Avoid concurrent hardware access
  	address, err := w.driver.Derive(path)
  	w.commsLock <- struct{}{}
  
  	w.stateLock.RUnlock()
  
  	// If an error occurred or no pinning was requested, return
  	if err != nil {
  		return accounts.Account{}, err
  	}
  	account := accounts.Account{
  		Address: address,
  		URL:     accounts.URL{Scheme: w.url.Scheme, Path: fmt.Sprintf("%s/%s", w.url.Path, path)},
  	}
  	if !pin {
  		return account, nil
  	}
  	// Pinning needs to modify the state
  	w.stateLock.Lock()
  	defer w.stateLock.Unlock()
  
  	if _, ok := w.paths[address]; !ok {
  		w.accounts = append(w.accounts, account)
  		w.paths[address] = path
  	}
  	return account, nil
  }
docs: // Derive implements accounts.Wallet, deriving a new account at the specific
  // derivation path. If pin is set to true, the account will be added to the list
  // of tracked accounts.