Skip to content

Instantly share code, notes, and snippets.

View eddywm's full-sized avatar
🚧
Building

Ed JR. eddywm

🚧
Building
View GitHub Profile
/** Kotlin code example for a block structure */
data class Block (
var index: Int = 0,
var hash: String = "",
var previousHash: String = "0",
var timestamp: Long = 0,
var nonce: Int = 0,
var numTx: Int = 0,
var transactions: Array<Transaction> = emptyArray()
)
@eddywm
eddywm / Transaction data structure.kt
Created January 16, 2018 16:19
A minimal structure of a Transaction in a blockchain system
data class Transaction (
var hash: String = "",
var type: TYPE = TYPE.REGULAR,
var inputs: Array<TransactionInput> = emptyArray(),
var outputs: Array<TransactionOutput> = emptyArray()
)
@eddywm
eddywm / Transaction output data structure.kt
Last active January 17, 2018 09:36
Minimal Transaction output data structure
data class TransactionOutput(
var amount: Long = 0,
var lockingScript: LinkedList<String> = LinkedList()
)
@eddywm
eddywm / Transaction Input data structure.kt
Last active January 16, 2018 16:36
Minimal Transaction Input data structure
data class TransactionInput (
var txid: String = ""
var vout: Int = 0
var amount: Long = 0,
var unlockingScript:LinkedList<String> = LinkedList()
)
1. sudo add-apt-repository ppa:fransschreuder1/qucs
2. sudo apt-get update
3. sudo apt-get install qucs
@eddywm
eddywm / Wallet verification unit tests.kt
Created September 29, 2018 23:55
Unit tests that were used in the XWallet app
import io.scintillamlabs.swallet.crypto.CryptoUtils
import io.scintillamlabs.swallet.crypto.CryptoUtils.SHA256Hex
import io.scintillamlabs.swallet.crypto.CryptoUtils.getPrivateKeyFromHex
import io.scintillamlabs.swallet.crypto.CryptoUtils.getPublicKeyFromHex
import io.scintillamlabs.swallet.utility.toHex
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test
import org.spongycastle.jce.provider.BouncyCastleProvider
@eddywm
eddywm / memo_checker.md
Last active March 31, 2023 14:30
ENABLING MEMO CHECKER

ENABLING MEMO CHECKER FOR AN ADDRESS

1. Install Binance-Chain Node CLI

sh <(wget -qO- https://raw.githubusercontent.com/onggunhao/node-binary/master/install.sh)

2. Add Wallet Phrase to the Node CLI

bnbcli keys add BEP2_WALLET --recover