Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0d4aa13
Offline signing support for the command line (cli) wallet
mullroy Oct 29, 2023
0ad1274
Update some printed messages
mullroy Oct 29, 2023
c3b7caf
Guide on how to set up an online (view only) and offline (signing) wa…
mullroy Oct 29, 2023
3e33382
Update README_offline_transaction_signing.md
mullroy Oct 29, 2023
d52883d
Offline mode: Test if the provided file has a secret key
mullroy Nov 4, 2023
a3bf7cf
Fix bug in Create_Encrypted_Wallet_Random() for evaluation of 'err'.
mullroy Nov 11, 2023
cd1fdbc
Initialise checksum value with 0x01
mullroy Nov 12, 2023
24c8a6c
Test if the wallet has a secret key.
mullroy Nov 12, 2023
1d182a5
Update transaction file layout
mullroy Nov 14, 2023
16dff00
Update structure of online/offline file
mullroy Nov 14, 2023
18c59f8
Update file format beteen online/offline wallet data exchange
mullroy Nov 14, 2023
8719591
Add burn_value to total expenditure evaluation
mullroy Nov 14, 2023
65c9c8c
Updates during h/w wallet integration
mullroy Dec 14, 2023
bbf816c
Merge branch 'main' of https://github.com/mullroy/derohe
mullroy Dec 14, 2023
0e98a69
Merge branch 'deroproject:main' into main
mullroy Dec 14, 2023
ea9fc89
Update README_offline_transaction_signing.md
mullroy Dec 14, 2023
1a670d3
Update README_offline_transaction_signing.md
mullroy Dec 14, 2023
b158db4
Update README_offline_transaction_signing.md
mullroy Dec 14, 2023
6da9a52
Update README_offline_transaction_signing.md
mullroy Dec 14, 2023
d1ef6f1
Update README_offline_transaction_signing.md
mullroy Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 288 additions & 0 deletions README_offline_transaction_signing.md

Large diffs are not rendered by default.

371 changes: 305 additions & 66 deletions cmd/dero-wallet-cli/easymenu_post_open.go

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions cmd/dero-wallet-cli/easymenu_pre_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import "time"
import "strconv"
import "strings"
import "encoding/hex"

import "github.com/chzyer/readline"

import "github.com/deroproject/derohe/cryptography/crypto"
Expand Down Expand Up @@ -143,7 +142,13 @@ func handle_easymenu_pre_open_command(l *readline.Instance, line string) {
break
}

wallett, err = walletapi.Create_Encrypted_Wallet(filename, password, new(crypto.BNRed).SetBytes(seed_raw))
seed := new(crypto.BNRed).SetBytes(seed_raw)
account,err2 := walletapi.Generate_Account_From_Seed ( seed )
if err2 != nil {
logger.Error(err, "Could not use the seed to create an account")
}

wallett, err = walletapi.Create_Encrypted_Wallet(filename, password, account)
if err != nil {
logger.Error(err, "Error while recovering wallet using seed key")
break
Expand Down Expand Up @@ -218,7 +223,15 @@ func handle_easymenu_pre_open_command(l *readline.Instance, line string) {
// sets online mode, starts RPC server etc
func common_processing(wallet *walletapi.Wallet_Disk) {
if globals.Arguments["--offline"].(bool) == true {
//offline_mode = true
// For an offline (signing) wallet, we require the secret key:
account := wallet.GetAccount()
sSecret := fmt.Sprintf("%x", account.Keys.Secret.BigInt() )
if ( len(sSecret)<=1 ) {
fmt.Printf("Your wallet doesn't have a secret key. Did you specify an online (view only) wallet (%s)?\n", globals.Arguments["--wallet-file"])
//Exit application
globals.Exit_In_Progress = true
return
}
} else {
wallet.SetOnlineMode()
}
Expand All @@ -245,7 +258,11 @@ func common_processing(wallet *walletapi.Wallet_Disk) {
wallet.SetSaveDuration(time.Duration(s) * time.Second)
logger.Info("Wallet changes will be saved every", "duration (seconds)", wallet.SetSaveDuration(-1))
}
} else {
//Initialise save duration to the duration in the --help menu: 300 seconds
wallet.SetSaveDuration(300 * time.Second)
}


wallet.SetNetwork(!globals.Arguments["--testnet"].(bool))

Expand Down
Loading