Title: | Bitcoin API |
---|---|
Description: | Implementation of the RPC-JSON API for Bitcoin and utility functions for address creation and content analysis of the blockchain. |
Authors: | Bernhard Pfaff [aut, cre] |
Maintainer: | Bernhard Pfaff <[email protected]> |
License: | GPL-3 |
Version: | 0.1-7 |
Built: | 2024-11-20 03:34:06 UTC |
Source: | https://github.com/cran/rbtc |
Attempts to add or remove a node from the addnode list. Or try a connection to a node once.
addnode(con, node, command = c("add", "remove", "onetry"))
addnode(con, node, command = c("add", "remove", "onetry"))
con |
object of class |
node |
|
command |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#addnode, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: clearbanned
,
disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
, setnetworkactive
This class definition is employed to cast the JSON-objects returned by API-calls to bitcoind.
rpcname
character
the name of the API.
result
ANY
the output/result of the API.
ecode
NullOrInteger
the error code,
in case of no error NULL
.
emessage
NullOrIntegerCharacter
the error message,
in case of no error NULL
.
id
character
identifier to API-call.
Other bitcoind functions: CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, conrpc
,
rpcpost
, startbtc
,
stopbtc
This is a modified binary-to-text decoding used for decoding Bitcoin addresses, aka Base58Check. If this is applied to a WIF address and the first and last four bytes are dropped, the result is the corresponding private key.
base58CheckDecode(x)
base58CheckDecode(x)
x |
|
list
, the decoded elements of the string.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address,
https://en.bitcoin.it/wiki/Base58Check_encoding
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
This is a modified binary-to-text encoding used for encoding Bitcoin addresses, aka Base58Check. If this is applied to an extended private key with its trailing check sum, then the result is the Wallet Import Format, (WIF).
base58CheckEncode(x)
base58CheckEncode(x)
x |
|
character
, the encoded string.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address,
https://en.bitcoin.it/wiki/Base58Check_encoding
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
This function returns the fee of the coinbase transaction. Hereby, the mining reward has been deducted. Initially, the mining reward was 50 BTC and is halved every 210,000 blocks.
bkfee(con, height)
bkfee(con, height)
con |
|
height |
|
numeric
Bernhard Pfaff
Other UtilityFuncs: blockattime
,
blockstats
, date2int
,
int2date
, intMaxDay
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function returns the block heights closest to a provided date/time (time zone is GMT).
blockattime(con, targetdate)
blockattime(con, targetdate)
con |
|
targetdate |
|
data.frame
: the heights, the times and
the time differences (in minutes) to the provided date/time.
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockstats
, date2int
,
int2date
, intMaxDay
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function returns key statistics of a block's content, such as the time, the count of transactions, and summary statistics of the UTXOs.
blockstats(con, height, excoinbase = TRUE)
blockstats(con, height, excoinbase = TRUE)
con |
|
height |
|
excoinbase |
|
An object of class data.frame
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, date2int
,
int2date
, intMaxDay
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
S4-class for BTC addresses, ordinarily created
by a call to createBtcAdr()
.
privkey
character
, the private key.
wif
character
, the WIF.
pubkey
character
, the 512-bit public key.
pubhash
character
, the hashed public key.
btcadr
character
, the BTC address.
mainnet
logical
, whether mainnet or testnet.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: PrivKey2PubKey
,
PrivKey2Wif
, PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
Clear all banned IPs.
clearbanned(con)
clearbanned(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#clearbanned, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
, setnetworkactive
This function concatenates two hex strings, provided without the 0x
prefix,
and returns a list
object of the associated
integers.
concatHex(hex1, hex2)
concatHex(hex1, hex2)
hex1 |
|
hex2 |
|
list
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
suppressWarnings(RNGversion("3.5.0")) h1 <- "80" h2 <- createPrivateKey() concatHex(h1, h2)
suppressWarnings(RNGversion("3.5.0")) h1 <- "80" h2 <- createPrivateKey() concatHex(h1, h2)
This function extracts information from the configuration
file bitcoin.conf
with respect to the options rpcuser
and rpcpassword
.
conrpc(conf.file)
conrpc(conf.file)
conf.file |
|
An S4-object of class CONRPC
.
Bernhard Pfaff
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, rpcpost
,
startbtc
, stopbtc
S4-class for curl connections to RPC-JSON.
The slots rpcuse
and rpcpwd
are required in the call
to curl
. Furthermore, the fully qualified path to
bitcoin.conf
(slot config
) is required for starting
and stopping bitcoind
as daemon.
Other bitcoind functions: ANSRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, conrpc
,
rpcpost
, startbtc
,
stopbtc
Checks whether a point is on a defined ellipctic curve.
containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,bigz,bigz' containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,integer,integer' containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,character,character' containsPoint(curve, x, y)
containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,bigz,bigz' containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,integer,integer' containsPoint(curve, x, y) ## S4 method for signature 'ECPARAM,character,character' containsPoint(curve, x, y)
curve |
an S4-object of class |
x |
an S4-object of class |
y |
an S4-object of class |
logical
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
ecoperators
, ecparam
,
ecpoint
, isNull
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" curve256 <- ecparam(p, a, b) Gx <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" Gy <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" containsPoint(curve256, Gx, Gy)
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" curve256 <- ecparam(p, a, b) Gx <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" Gy <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" containsPoint(curve256, Gx, Gy)
This function creates an object of S4-class BTCADR
.
createBtcAdr(privkey, mainnet = TRUE)
createBtcAdr(privkey, mainnet = TRUE)
privkey |
|
mainnet |
|
Object of S4-class BTCADR
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
Returns a random 256-bit private key in hex notation.
createPrivateKey()
createPrivateKey()
character
.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
, decodeHex
,
hash160
, hash256
,
validBtcAdr
suppressWarnings(RNGversion("3.5.0")) createPrivateKey()
suppressWarnings(RNGversion("3.5.0")) createPrivateKey()
This function returns the associated integer
time
for a given date/time object (coercible as POSIXct
object.
date2int(x)
date2int(x)
x |
|
integer
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
int2date
, intMaxDay
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
d <- "2017-03-15" date2int(d)
d <- "2017-03-15" date2int(d)
This function converts a hex string,, whereby the string must not
contain the 0x
prefix, to a list
object with the associated
integers as its elements.
decodeHex(s)
decodeHex(s)
s |
|
list
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, hash160
,
hash256
, validBtcAdr
suppressWarnings(RNGversion("3.5.0")) pk <- createPrivateKey() decodeHex(pk)
suppressWarnings(RNGversion("3.5.0")) pk <- createPrivateKey() decodeHex(pk)
Return a JSON object representing the serialized, hex-encoded transaction.
decoderawtransaction(con, hexstring)
decoderawtransaction(con, hexstring)
con |
object of class |
hexstring |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other RawTransactions RPCs: getrawtransaction
The decodescript RPC decodes a hex-encoded P2SH redeem script.
decodescript(con, redeem)
decodescript(con, redeem)
con |
object of class |
redeem |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#decodescript, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Immediately disconnects from the specified peer node.
Strictly one out of address
and nodeid
can be
provided to identify the node.
disconnectnode(con, address = NULL, nodeid = NULL)
disconnectnode(con, address = NULL, nodeid = NULL)
con |
object of class |
address |
|
nodeid |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#disconnectnode, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
, setnetworkactive
The following operarations for EC points are available:
multiplying a point by itself
point addition
highest bit value of an integer
logical and-operator for two integers
multiplication of an integer scalar with an EC point
doubleUp(ecp) ## S4 method for signature 'ECPOINT' doubleUp(ecp) ## S4 method for signature 'ECPOINT,ECPOINT' e1 + e2 leftmostBit(x) ## S4 method for signature 'bigz' leftmostBit(x) AND(x, y) ## S4 method for signature 'bigz,bigz' AND(x, y) ## S4 method for signature 'ECPOINT,bigz' e1 * e2 ## S4 method for signature 'bigz,ECPOINT' e1 * e2
doubleUp(ecp) ## S4 method for signature 'ECPOINT' doubleUp(ecp) ## S4 method for signature 'ECPOINT,ECPOINT' e1 + e2 leftmostBit(x) ## S4 method for signature 'bigz' leftmostBit(x) AND(x, y) ## S4 method for signature 'bigz,bigz' AND(x, y) ## S4 method for signature 'ECPOINT,bigz' e1 * e2 ## S4 method for signature 'bigz,ECPOINT' e1 * e2
ecp |
point on elliptic curve |
e1 |
point on elliptic curve, or integer |
e2 |
point on elliptic curve, or integer |
x |
integer |
y |
integer |
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint
, ecparam
,
ecpoint
, isNull
This function returns an object of S4-class ECPARAM
,
that does contain the parametrization of an elliptic curve.
ecparam(p, a, b)
ecparam(p, a, b)
p |
|
a |
|
b |
|
An object of S4-class ECPARAM
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint
, ecoperators
,
ecpoint
, isNull
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" curve256 <- ecparam(p, a, b) curve256
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" curve256 <- ecparam(p, a, b) curve256
S4-class for elliptic curve parameters.
Objects of this class do contain the big integer parameters of
elliptic curves. Instances of this class are ordinarily created
by a call to exparam
p
bigz
, curve dimension.
a
bigz
, parameter.
b
bigz
, parameter.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPOINT-class
,
EcparamOrNull-class
,
containsPoint
, ecoperators
,
ecparam
, ecpoint
,
isNull
S4-class union of NULL
or ECPARAM
.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
, containsPoint
,
ecoperators
, ecparam
,
ecpoint
, isNull
This function returns an object of S4-class ECPOINT
,
that does represent a point on an elliptic curve.
ecpoint(ecparam = NULL, x, y, r = NULL)
ecpoint(ecparam = NULL, x, y, r = NULL)
ecparam |
|
x |
x-coordinate, to be coercible to |
y |
y-coordinate, to be coercible to |
r |
the order of the base point. |
An object of S4-class ECPOINT
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint
, ecoperators
,
ecparam
, isNull
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" r <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141" x <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" y <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" curve256 <- ecparam(p, a, b) ecp <- ecpoint(curve256, x, y, r) ecp
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F" b <- "0x0000000000000000000000000000000000000000000000000000000000000007" a <- "0x0000000000000000000000000000000000000000000000000000000000000000" r <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141" x <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" y <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" curve256 <- ecparam(p, a, b) ecp <- ecpoint(curve256, x, y, r) ecp
S4-class for a point on an elliptic curve.
Ordinarily, objects are created by calling
ecpoint
.
ecparam
ECPARAM
x
bigz
y
bigz
r
bigz
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
EcparamOrNull-class
,
containsPoint
, ecoperators
,
ecparam
, ecpoint
,
isNull
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)
getaddednodeinfo(con, node = NULL)
getaddednodeinfo(con, node = NULL)
con |
object of class |
node |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getaddednodeinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
, setnetworkactive
Returns the hash of the best (tip) block in the longest blockchain.
getbestblockhash(con)
getbestblockhash(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getbestblockhash, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns information of a block hash. The returned level of details depends on the
argument verbosity
.
getblock(con, blockhash, verbosity = c("l1", "l0", "l2"))
getblock(con, blockhash, verbosity = c("l1", "l0", "l2"))
con |
object of class |
blockhash |
|
verbosity |
|
If verbosity is 'l0', returns a string that is serialized, hex-encoded data for block 'hash'. If verbosity is 'l1' (the default), returns an object with information about block <hash>. If verbosity is 'l2', returns an object with information about block <hash> and information about each transaction.
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns an object containing various state info regarding blockchain processing.
getblockchaininfo(con)
getblockchaininfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblockchaininfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns the number of blocks in the longest blockchain.
getblockcount(con)
getblockcount(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblockcount, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockhash
, getblockheader
,
getblock
, getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns hash of block in best-block-chain at height provided.
getblockhash(con, height)
getblockhash(con, height)
con |
object of class |
height |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblockhash, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns the block header for a given hash string.
getblockheader(con, hash, verbose = TRUE)
getblockheader(con, hash, verbose = TRUE)
con |
object of class |
hash |
|
verbose |
|
A S4-object of class ANSRPC
.
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader <hash>.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblockheader, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblock
, getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
getchaintips(con)
getchaintips(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getchaintips, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Compute statistics about the total number and rate of transactions in the chain.
getchaintxstats(con, nblocks = NULL, blockhash = NULL)
getchaintxstats(con, nblocks = NULL, blockhash = NULL)
con |
object of class |
nblocks |
|
blockhash |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getchaintxstats, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
, getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns the number of connections to other nodes.
getconnectioncount(con)
getconnectioncount(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getconnectioncount, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
, setnetworkactive
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
getdifficulty(con)
getdifficulty(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getdifficulty, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returning information about RPC functions.
gethelp(con, rpc = "")
gethelp(con, rpc = "")
con |
object of class |
rpc |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#help, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Control RPCs: getinfo
,
getwalletinfo
Returning information about bitcoin configuration and settings.
getinfo(con)
getinfo(con)
con |
object of class |
WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16.
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Control RPCs: gethelp
,
getwalletinfo
If txid is in the mempool, returns all in-mempool ancestors.
getmempoolancestors(con, txid, verbose = FALSE)
getmempoolancestors(con, txid, verbose = FALSE)
con |
object of class |
txid |
|
verbose |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getmempoolancestors, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
If txid is in the mempool, returns all in-mempool descendants.
getmempooldescendants(con, txid, verbose = FALSE)
getmempooldescendants(con, txid, verbose = FALSE)
con |
object of class |
txid |
|
verbose |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getmempooldescendants, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns mempool data for given transaction.
getmempoolentry(con, txid)
getmempoolentry(con, txid)
con |
object of class |
txid |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getmempoolentry, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns details on the active state of the TX memory pool.
getmempoolinfo(con)
getmempoolinfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getmempoolinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns information about network traffic, including bytes in, bytes out, and current time.
getnettotals(con)
getnettotals(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getnettotals, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnetworkinfo
, getpeerinfo
,
listbanned
, ping
,
setnetworkactive
Returns an object containing various state info regarding P2P networking.
getnetworkinfo(con)
getnetworkinfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getnetworkinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getpeerinfo
,
listbanned
, ping
,
setnetworkactive
Returns data about each connected network node as a json array of objects.
getpeerinfo(con)
getpeerinfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getpeerinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
listbanned
, ping
,
setnetworkactive
Returns all transaction ids in memory pool as a json array of string transaction ids. Hint: use getmempoolentry to fetch a specific transaction from the mempool.
getrawmempool(con, verbose = TRUE)
getrawmempool(con, verbose = TRUE)
con |
object of class |
verbose |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getrawmempool, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns the raw transaction data.
getrawtransaction(con, txid, verbose = FALSE)
getrawtransaction(con, txid, verbose = FALSE)
con |
object of class |
txid |
|
verbose |
|
By default this function only works for mempool transactions. If the -txindex option is enabled, it also works for blockchain transactions. DEPRECATED: for now, it also works for transactions with unspent outputs. If verbose is 'true', returns an object with information about 'txid'. If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other RawTransactions RPCs: decoderawtransaction
Returns details about an unspent transaction output.
gettxout(con, txid, n, incmempool = TRUE)
gettxout(con, txid, n, incmempool = TRUE)
con |
object of class |
txid |
|
n |
|
incmempool |
|
Note that an unspent output that is spent in the mempool won't appear.
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#gettxout, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns a hex-encoded proof that "txid" was included in a block.
gettxoutproof(con, txids, blockhash = NULL)
gettxoutproof(con, txids, blockhash = NULL)
con |
object of class |
txids |
|
blockhash |
|
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#gettxoutproof, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returns statistics about the unspent transaction output set. Note this call may take some time.
gettxoutsetinfo(con)
gettxoutsetinfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#gettxoutsetinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxout
, preciousblock
,
pruneblockchain
, verifychain
,
verifytxoutproof
Returning information about bitcoin wallet.
getwalletinfo(con)
getwalletinfo(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#getwalletinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Control RPCs: gethelp
,
getinfo
This function returns the hash by applying the sha256
hashing
first and then to the resulting hash the ripemd160
algorithm.
hash160(d)
hash160(d)
d |
|
character
, the value of d
hashed with
sha256
and ripemd160
.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash256
, validBtcAdr
This function returns the hash by applying the sha256
hashing
algorithm twice to a raw
object.
hash256(d)
hash256(d)
d |
|
character
, the value of d
hashed twice.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, validBtcAdr
This function returns the associated POSIXct
time
to the time stamp integer in a block header.
int2date(x)
int2date(x)
x |
|
An object of class POSIXct, POSIXt
Bernhard Pfaff
https://en.bitcoin.it/wiki/Block_timestamp
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, intMaxDay
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
ts <- 1532954868 int2date(ts)
ts <- 1532954868 int2date(ts)
This function returns the associated integer
time
for the end of a specific day (i.e., 23:59:59
time).
intMaxDay(x)
intMaxDay(x)
x |
|
integer
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMinDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
d1 <- "2017-03-15" d1 <- intMaxDay(d1) d2 <- "2017-03-15 23:59:59" d2 <- intMaxDay(d2) identical(d1,d2)
d1 <- "2017-03-15" d1 <- intMaxDay(d1) d2 <- "2017-03-15 23:59:59" d2 <- intMaxDay(d2) identical(d1,d2)
This function returns the associated integer
time
for the start of a specific day (i.e., 00:00:00
time).
intMinDay(x)
intMinDay(x)
x |
|
integer
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intRangeDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
d1 <- "2017-03-15" d1 <- intMinDay(d1) d2 <- "2017-03-15 00:00:00" d2 <- intMinDay(d2) identical(d1,d2)
d1 <- "2017-03-15" d1 <- intMinDay(d1) d2 <- "2017-03-15 00:00:00" d2 <- intMinDay(d2) identical(d1,d2)
This function returns the associated integer
times
for the start and end of a specific day.
intRangeDay(x)
intRangeDay(x)
x |
|
integer
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangePeriod
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
d1 <- "2017-03-15" intRangeDay(d1) intMinDay(d1) intMaxDay(d1)
d1 <- "2017-03-15" intRangeDay(d1) intMinDay(d1) intMaxDay(d1)
This function returns the associated integer
times
for the start of date d1
and the end of date d2
.
intRangePeriod(d1, d2)
intRangePeriod(d1, d2)
d1 |
|
d2 |
|
integer
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, timeofblock
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
d1 <- "2017-03-15" d2 <- "2017-04-15" intRangePeriod(d1, d2) intMinDay(d1) intMaxDay(d2)
d1 <- "2017-03-15" d2 <- "2017-04-15" intRangePeriod(d1, d2) intMinDay(d1) intMaxDay(d2)
Checks whether an EC point does exist.
isNull(x) ## S4 method for signature 'ECPOINT' isNull(x)
isNull(x) ## S4 method for signature 'ECPOINT' isNull(x)
x |
object |
logical
Bernhard Pfaff
https://en.bitcoin.it/wiki/Secp256k1
Other EllipticCurve: ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint
, ecoperators
,
ecparam
, ecpoint
List all banned IPs/Subnets.
listbanned(con)
listbanned(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#listbanned, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, ping
,
setnetworkactive
S4-class union of NULL
or character
.
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrInteger-class
, conrpc
,
rpcpost
, startbtc
,
stopbtc
S4-class union of NULL
or integer
.
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
conrpc
, rpcpost
,
startbtc
, stopbtc
Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
ping(con)
ping(con)
con |
object of class |
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#ping, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
setnetworkactive
Treats a block as if it were received before others with the same work. A can override the effect of an earlier one. The effects of preciousblock are not retained across restarts.
preciousblock(con, blockhash)
preciousblock(con, blockhash)
con |
object of class |
blockhash |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#preciousblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
pruneblockchain
, verifychain
,
verifytxoutproof
This function creates the 512-bit public key corresponding to a private key.
PrivKey2PubKey(privkey, mainnet = TRUE)
PrivKey2PubKey(privkey, mainnet = TRUE)
privkey |
|
mainnet |
|
character
, the public key.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2Wif
, PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
Returns the corresponding WIF key from a private key
PrivKey2Wif(privkey, mainnet = TRUE)
PrivKey2Wif(privkey, mainnet = TRUE)
privkey |
|
mainnet |
|
character
, the WIF key
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
suppressWarnings(RNGversion("3.5.0")) pk <- createPrivateKey() PrivKey2Wif(pk)
suppressWarnings(RNGversion("3.5.0")) pk <- createPrivateKey() PrivKey2Wif(pk)
Pruning of blockchain.
pruneblockchain(con, height)
pruneblockchain(con, height)
con |
object of class |
height |
|
A S4-object of class ANSRPC
.
May be set to a discrete height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#pruneblockchain, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
, verifychain
,
verifytxoutproof
This function returns the corresponding BTC address from a hashed public key.
PubHash2BtcAdr(pubhash)
PubHash2BtcAdr(pubhash)
pubhash |
|
character
, the BTC address
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
This function returns the associated public key hash
from a 512-bit public key by using the hash160()
function.
PubKey2PubHash(pubkey, mainnet = TRUE)
PubKey2PubHash(pubkey, mainnet = TRUE)
pubkey |
|
mainnet |
|
character
, the hash of a public key
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
This function executes an RPC-JSON post.
rpcpost(con, api, plist = list())
rpcpost(con, api, plist = list())
con |
|
api |
|
plist |
|
A list
object, coerced JSON answer from RPC.
Bernhard Pfaff
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, conrpc
,
startbtc
, stopbtc
Disable/enable all p2p network activity.
setnetworkactive(con, state = TRUE)
setnetworkactive(con, state = TRUE)
con |
object of class |
state |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#setnetworkactive, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Network RPCs: addnode
,
clearbanned
, disconnectnode
,
getaddednodeinfo
,
getconnectioncount
,
getnettotals
, getnetworkinfo
,
getpeerinfo
, listbanned
,
ping
Defined show
-methods for S4-classes.
## S4 method for signature 'ANSRPC' show(object) ## S4 method for signature 'BTCADR' show(object) ## S4 method for signature 'ECPARAM' show(object)
## S4 method for signature 'ANSRPC' show(object) ## S4 method for signature 'BTCADR' show(object) ## S4 method for signature 'ECPARAM' show(object)
object |
a S4-class object. |
This function does start the bitcoind-server process. It should only be called when no suitable RPC-JSON process is running
startbtc(confbtc)
startbtc(confbtc)
confbtc |
|
The process is started by calling system()
.
Hereby, the options: rpcuser
, rpcpassword
and
conf
are used in the call to bitcoind
.
NULL
Bernhard Pfaff
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, conrpc
,
rpcpost
, stopbtc
This function stops a running bitcoind process.
It calls bitcoin-cli stop
via the
R function system()
.
stopbtc(confbtc)
stopbtc(confbtc)
confbtc |
|
Bernhard Pfaff
Other bitcoind functions: ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
, conrpc
,
rpcpost
, startbtc
This function returns the time of a block in GMT.
timeofblock(con, height)
timeofblock(con, height)
con |
|
height |
|
POSIXct
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
txfee
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function returns the implicit fee of a transaction, by computing the difference between the sum of its inputs and the sum of its outputs.
txfee(con, txid)
txfee(con, txid)
con |
|
txid |
|
numeric
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txids
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function retrieves the transaction IDs in a block.
txids(con, height, excoinbase = TRUE)
txids(con, height, excoinbase = TRUE)
con |
|
height |
|
excoinbase |
|
character
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txinids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function returns the transaction IDs of the inputs for a given transaction.
txinids(con, txid)
txinids(con, txid)
con |
|
txid |
|
data.frame
, the transaction ID(s) and
the position(s) of the previous UTXO(s).
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txids
, txstats
,
utxoage
, utxotype
,
utxovalue
This function returns key statistics/characteristics of a transaction.
txstats(con, txid)
txstats(con, txid)
con |
|
txid |
|
data.frame
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txids
, txinids
,
utxoage
, utxotype
,
utxovalue
This function returns a difftime
object measuring the elapsed time(s)
between the UTXO(s) in a transaction and its input(s) (previous UTXO(s)).
utxoage(con, txid, units = c("auto", "secs", "mins", "hours", "days", "weeks"))
utxoage(con, txid, units = c("auto", "secs", "mins", "hours", "days", "weeks"))
con |
|
txid |
|
units |
|
difftime
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txids
, txinids
,
txstats
, utxotype
,
utxovalue
This function returns the types of the UTXO(s) in a transaction.
utxotype(con, txid)
utxotype(con, txid)
con |
|
txid |
|
character
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txids
, txinids
,
txstats
, utxoage
,
utxovalue
This function returns the values of UTXO(s) in a transaction.
utxovalue(con, txid)
utxovalue(con, txid)
con |
|
txid |
|
numeric
Bernhard Pfaff
Other UtilityFuncs: bkfee
,
blockattime
, blockstats
,
date2int
, int2date
,
intMaxDay
, intMinDay
,
intRangeDay
, intRangePeriod
,
timeofblock
, txfee
,
txids
, txinids
,
txstats
, utxoage
,
utxotype
This function validates objects of S4-class
BTCADR
. Hereby, checks are conducted
with respect to the first character of the addresses;
their consistency with the net version and
the correspondence of the checksums.
validBtcAdr(object)
validBtcAdr(object)
object |
|
Bernhard Pfaff
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
, Wif2PrivKey
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
Verifies blockchain database.
verifychain(con, checklevel = NULL, nblocks = NULL)
verifychain(con, checklevel = NULL, nblocks = NULL)
con |
object of class |
checklevel |
|
nblocks |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#verifychain, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
,
verifytxoutproof
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain.
verifytxoutproof(con, proof)
verifytxoutproof(con, proof)
con |
object of class |
proof |
|
A S4-object of class ANSRPC
.
Bernhard Pfaff
https://bitcoin.org/en/developer-reference#verifytxoutproof, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
Other Blockchain RPCs: decodescript
,
getbestblockhash
,
getblockchaininfo
,
getblockcount
, getblockhash
,
getblockheader
, getblock
,
getchaintips
,
getchaintxstats
,
getdifficulty
,
getmempoolancestors
,
getmempooldescendants
,
getmempoolentry
,
getmempoolinfo
,
getrawmempool
, gettxoutproof
,
gettxoutsetinfo
, gettxout
,
preciousblock
,
pruneblockchain
, verifychain
Returns the corresponding private key from a WIF key.
Wif2PrivKey(wif)
Wif2PrivKey(wif)
wif |
|
character
, the corresponding private key.
Bernhard Pfaff
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
Other BtcAdresses: BTCADR-class
,
PrivKey2PubKey
, PrivKey2Wif
,
PubHash2BtcAdr
,
PubKey2PubHash
,
base58CheckDecode
,
base58CheckEncode
, concatHex
,
createBtcAdr
,
createPrivateKey
, decodeHex
,
hash160
, hash256
,
validBtcAdr
suppressWarnings(RNGversion("3.5.0")) pk1 <- createPrivateKey() wif <- PrivKey2Wif(pk1) pk2 <- Wif2PrivKey(wif) identical(pk1, pk2)
suppressWarnings(RNGversion("3.5.0")) pk1 <- createPrivateKey() wif <- PrivKey2Wif(pk1) pk2 <- Wif2PrivKey(wif) identical(pk1, pk2)