Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aureleoules/txcore

🔨 The missing lightweight Bitcoin TX builder written in Go
https://github.com/aureleoules/txcore

bitcoin-tx go lightweight

Last synced: 2 months ago
JSON representation

🔨 The missing lightweight Bitcoin TX builder written in Go

Awesome Lists containing this project

README

        




TXCore


TXCore


The missing lightweight Bitcoin TX builder written in Go






## Usage

```go
tx := txcore.NewTX()

tx.AddInput("TxId", "Base58Address", outputIndex, isCompressed)
tx.AddInput("TxId2", "AnotherBase58Address", output2Index, isCompressed)
...

tx.AddOutput("abc", 100_000_000) // send one bitcoin to abc
tx.AddOutput("xyz", 300_000_000) // send three bitcoins to xyz
...

// Build raw tx
tx.Build()

// Sign with the corresponding private keys
tx.Sign([]string{"privateKey1", "privateKey2", ...})

// Print signed tx
fmt.Println(tx.SignedTXHex)
```

## License
MIT