btcs

bitcoin script parser/evaluator/compiler/decompiler
git clone git://jb55.com/btcs
Log | Files | Refs | README | LICENSE

commit de5792eb48229bbcd478e23945d4809ccadc7ce6
parent 560a823bf54ffa11ef04d04a0be9dc29e2ea413a
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 24 Oct 2017 10:24:04 -0700

script: initial script stuff

Diffstat:
Ascript.c | 7+++++++
Ascript.h | 39+++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/script.c b/script.c @@ -0,0 +1,7 @@ + +#include "script.h" + +void +script_eval(struct script *script, struct script_state *state) { + +} diff --git a/script.h b/script.h @@ -0,0 +1,39 @@ + +#ifndef BTCS_SCRIPT_H +#define BTCS_SCRIPT_H + +#include "op.h" + +// Maximum number of bytes pushable to the stack +static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; + +// Maximum number of non-push operations per script +static const int MAX_OPS_PER_SCRIPT = 201; + +// Maximum number of public keys per multisig +static const int MAX_PUBKEYS_PER_MULTISIG = 20; + +// Maximum script length in bytes +static const int MAX_SCRIPT_SIZE = 10000; + +// Maximum number of values on script interpreter stack +static const int MAX_STACK_SIZE = 1000; + +// Maximum value that an opcode can be +static const unsigned int MAX_OPCODE = OP_NOP10; + +// Threshold for nLockTime: below this value it is interpreted as block number, +// otherwise as UNIX timestamp. +static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC + +struct script { +}; + +struct script_state { +}; + +void +script_eval(struct script *, struct script_state*); + + +#endif /* BTCS_SCRIPT_H */